@uniformdev/design-system 19.177.1 → 19.177.2-alpha.10
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 +1095 -243
- package/dist/index.d.mts +16 -3
- package/dist/index.d.ts +16 -3
- package/dist/index.js +1084 -251
- package/package.json +14 -13
package/dist/esm/index.js
CHANGED
|
@@ -12449,6 +12449,7 @@ var Menu = React7.forwardRef(function Menu2({
|
|
|
12449
12449
|
menuItemsContainerCssClasses,
|
|
12450
12450
|
testId,
|
|
12451
12451
|
maxMenuHeight,
|
|
12452
|
+
portalElement,
|
|
12452
12453
|
...props
|
|
12453
12454
|
}, ref) {
|
|
12454
12455
|
const placementOverride = legacyPlacements.includes(placement) ? void 0 : placement;
|
|
@@ -12459,6 +12460,7 @@ var Menu = React7.forwardRef(function Menu2({
|
|
|
12459
12460
|
BaseMenu,
|
|
12460
12461
|
{
|
|
12461
12462
|
portal: !withoutPortal,
|
|
12463
|
+
portalElement,
|
|
12462
12464
|
unmountOnHide: true,
|
|
12463
12465
|
gutter: 0,
|
|
12464
12466
|
shift: menu.parent ? -4 : 0,
|
|
@@ -20245,7 +20247,7 @@ var ParameterNameAndPublicIdInput = ({
|
|
|
20245
20247
|
};
|
|
20246
20248
|
|
|
20247
20249
|
// src/components/ParameterInputs/ParameterRichText.tsx
|
|
20248
|
-
import { css as
|
|
20250
|
+
import { css as css100 } from "@emotion/react";
|
|
20249
20251
|
import { ListItemNode, ListNode as ListNode2 } from "@lexical/list";
|
|
20250
20252
|
import {
|
|
20251
20253
|
CODE,
|
|
@@ -20257,14 +20259,16 @@ import {
|
|
|
20257
20259
|
UNORDERED_LIST
|
|
20258
20260
|
} from "@lexical/markdown";
|
|
20259
20261
|
import { LexicalComposer } from "@lexical/react/LexicalComposer";
|
|
20260
|
-
import { useLexicalComposerContext as
|
|
20262
|
+
import { useLexicalComposerContext as useLexicalComposerContext7 } from "@lexical/react/LexicalComposerContext";
|
|
20261
20263
|
import { ContentEditable } from "@lexical/react/LexicalContentEditable";
|
|
20262
20264
|
import LexicalErrorBoundary from "@lexical/react/LexicalErrorBoundary";
|
|
20263
20265
|
import { HistoryPlugin } from "@lexical/react/LexicalHistoryPlugin";
|
|
20264
20266
|
import { ListPlugin } from "@lexical/react/LexicalListPlugin";
|
|
20265
20267
|
import { MarkdownShortcutPlugin } from "@lexical/react/LexicalMarkdownShortcutPlugin";
|
|
20266
20268
|
import { RichTextPlugin } from "@lexical/react/LexicalRichTextPlugin";
|
|
20269
|
+
import { TablePlugin } from "@lexical/react/LexicalTablePlugin";
|
|
20267
20270
|
import { HeadingNode, QuoteNode } from "@lexical/rich-text";
|
|
20271
|
+
import { TableCellNode as TableCellNode2, TableNode, TableRowNode as TableRowNode2 } from "@lexical/table";
|
|
20268
20272
|
|
|
20269
20273
|
// ../richtext/dist/index.mjs
|
|
20270
20274
|
var richTextBuiltInElements = [
|
|
@@ -20312,6 +20316,10 @@ var richTextBuiltInElements = [
|
|
|
20312
20316
|
label: "Code Block",
|
|
20313
20317
|
type: "code"
|
|
20314
20318
|
},
|
|
20319
|
+
{
|
|
20320
|
+
label: "Table",
|
|
20321
|
+
type: "table"
|
|
20322
|
+
},
|
|
20315
20323
|
{
|
|
20316
20324
|
label: "Dynamic Token",
|
|
20317
20325
|
type: "variable"
|
|
@@ -20359,7 +20367,7 @@ var getLabelForElement = (type) => {
|
|
|
20359
20367
|
// src/components/ParameterInputs/ParameterRichText.tsx
|
|
20360
20368
|
import { deepEqual as deepEqual2 } from "fast-equals";
|
|
20361
20369
|
import { ParagraphNode as ParagraphNode2 } from "lexical";
|
|
20362
|
-
import { useEffect as
|
|
20370
|
+
import { useEffect as useEffect23, useState as useState20 } from "react";
|
|
20363
20371
|
|
|
20364
20372
|
// src/components/ParameterInputs/rich-text/CustomCodeNode.ts
|
|
20365
20373
|
import { CodeNode } from "@lexical/code";
|
|
@@ -20574,6 +20582,46 @@ var codeElement = css95`
|
|
|
20574
20582
|
margin-bottom: 0;
|
|
20575
20583
|
}
|
|
20576
20584
|
`;
|
|
20585
|
+
var tableElement = css95`
|
|
20586
|
+
border-collapse: collapse;
|
|
20587
|
+
border-spacing: 0;
|
|
20588
|
+
border-color: var(--gray-300);
|
|
20589
|
+
border-width: 1px;
|
|
20590
|
+
border-style: solid;
|
|
20591
|
+
margin-bottom: var(--spacing-base);
|
|
20592
|
+
margin-top: 0;
|
|
20593
|
+
|
|
20594
|
+
&:last-child {
|
|
20595
|
+
margin-bottom: 0;
|
|
20596
|
+
}
|
|
20597
|
+
`;
|
|
20598
|
+
var tableCellElement = css95`
|
|
20599
|
+
background-color: var(--white);
|
|
20600
|
+
border-color: var(--gray-300);
|
|
20601
|
+
border-style: solid;
|
|
20602
|
+
border-width: 1px;
|
|
20603
|
+
box-sizing: unset;
|
|
20604
|
+
min-width: 2rem;
|
|
20605
|
+
outline: none;
|
|
20606
|
+
padding: var(--spacing-sm);
|
|
20607
|
+
text-align: start;
|
|
20608
|
+
vertical-align: top;
|
|
20609
|
+
width: 7rem;
|
|
20610
|
+
`;
|
|
20611
|
+
var tableHeaderElement = css95`
|
|
20612
|
+
background-color: var(--gray-100);
|
|
20613
|
+
border-color: var(--gray-300);
|
|
20614
|
+
border-style: solid;
|
|
20615
|
+
border-width: 1px;
|
|
20616
|
+
box-sizing: unset;
|
|
20617
|
+
font-weight: normal;
|
|
20618
|
+
min-width: 2rem;
|
|
20619
|
+
outline: none;
|
|
20620
|
+
padding: var(--spacing-sm);
|
|
20621
|
+
text-align: start;
|
|
20622
|
+
vertical-align: top;
|
|
20623
|
+
width: 7rem;
|
|
20624
|
+
`;
|
|
20577
20625
|
|
|
20578
20626
|
// src/components/ParameterInputs/rich-text/LinkNodePlugin.tsx
|
|
20579
20627
|
import { css as css96 } from "@emotion/react";
|
|
@@ -20929,7 +20977,11 @@ var linkPopoverAnchor = css96`
|
|
|
20929
20977
|
${link}
|
|
20930
20978
|
${linkColorDefault}
|
|
20931
20979
|
`;
|
|
20932
|
-
function LinkNodePlugin({
|
|
20980
|
+
function LinkNodePlugin({
|
|
20981
|
+
onConnectLink,
|
|
20982
|
+
getBoundPath,
|
|
20983
|
+
positioningAnchorEl
|
|
20984
|
+
}) {
|
|
20933
20985
|
const parsePath = getBoundPath != null ? getBoundPath : function(path) {
|
|
20934
20986
|
return path;
|
|
20935
20987
|
};
|
|
@@ -21033,9 +21085,11 @@ function LinkNodePlugin({ onConnectLink, getBoundPath }) {
|
|
|
21033
21085
|
setLinkPopoverState(void 0);
|
|
21034
21086
|
return;
|
|
21035
21087
|
}
|
|
21088
|
+
const elementRect = element.getBoundingClientRect();
|
|
21089
|
+
const positioningAnchorRect = positioningAnchorEl.getBoundingClientRect();
|
|
21036
21090
|
const { x, y } = {
|
|
21037
|
-
x:
|
|
21038
|
-
y:
|
|
21091
|
+
x: elementRect.left - positioningAnchorRect.left + LINK_POPOVER_OFFSET_X,
|
|
21092
|
+
y: elementRect.top + elementRect.height - positioningAnchorRect.top + LINK_POPOVER_OFFSET_Y
|
|
21039
21093
|
};
|
|
21040
21094
|
setLinkPopoverState({
|
|
21041
21095
|
node: linkNode,
|
|
@@ -21044,7 +21098,7 @@ function LinkNodePlugin({ onConnectLink, getBoundPath }) {
|
|
|
21044
21098
|
y
|
|
21045
21099
|
}
|
|
21046
21100
|
});
|
|
21047
|
-
}, [editor]);
|
|
21101
|
+
}, [editor, positioningAnchorEl]);
|
|
21048
21102
|
useEffect18(() => {
|
|
21049
21103
|
return editor.registerUpdateListener(({ editorState }) => {
|
|
21050
21104
|
requestAnimationFrame(() => {
|
|
@@ -21184,6 +21238,7 @@ import {
|
|
|
21184
21238
|
import { useLexicalComposerContext as useLexicalComposerContext4 } from "@lexical/react/LexicalComposerContext";
|
|
21185
21239
|
import { $createHeadingNode, $createQuoteNode, $isHeadingNode } from "@lexical/rich-text";
|
|
21186
21240
|
import { $setBlocksType } from "@lexical/selection";
|
|
21241
|
+
import { $createTableNodeWithDimensions } from "@lexical/table";
|
|
21187
21242
|
import { $findMatchingParent, $getNearestNodeOfType } from "@lexical/utils";
|
|
21188
21243
|
import {
|
|
21189
21244
|
$createParagraphNode,
|
|
@@ -21197,12 +21252,14 @@ import {
|
|
|
21197
21252
|
import { useCallback as useCallback11, useEffect as useEffect20, useMemo as useMemo6, useState as useState17 } from "react";
|
|
21198
21253
|
import { Fragment as Fragment19, jsx as jsx130, jsxs as jsxs86 } from "@emotion/react/jsx-runtime";
|
|
21199
21254
|
var toolbar = css97`
|
|
21255
|
+
${scrollbarStyles}
|
|
21200
21256
|
background: var(--gray-50);
|
|
21201
21257
|
border-radius: var(--rounded-base);
|
|
21202
21258
|
display: flex;
|
|
21203
21259
|
/* We add 1px because we use a 1px wide separator */
|
|
21204
21260
|
gap: calc(var(--spacing-sm) + 1px);
|
|
21205
21261
|
margin: calc(var(--spacing-sm) + var(--spacing-xs)) 0;
|
|
21262
|
+
overflow: auto;
|
|
21206
21263
|
padding: var(--spacing-sm);
|
|
21207
21264
|
position: sticky;
|
|
21208
21265
|
top: calc(var(--spacing-sm) * -2);
|
|
@@ -21210,6 +21267,7 @@ var toolbar = css97`
|
|
|
21210
21267
|
`;
|
|
21211
21268
|
var toolbarGroup = css97`
|
|
21212
21269
|
display: flex;
|
|
21270
|
+
flex-shrink: 0;
|
|
21213
21271
|
gap: var(--spacing-xs);
|
|
21214
21272
|
position: relative;
|
|
21215
21273
|
|
|
@@ -21232,6 +21290,7 @@ var richTextToolbarButton = css97`
|
|
|
21232
21290
|
box-shadow: none;
|
|
21233
21291
|
color: var(--gray-900);
|
|
21234
21292
|
display: flex;
|
|
21293
|
+
flex-shrink: 0;
|
|
21235
21294
|
height: 32px;
|
|
21236
21295
|
justify-content: center;
|
|
21237
21296
|
min-width: 32px;
|
|
@@ -21240,6 +21299,10 @@ var richTextToolbarButton = css97`
|
|
|
21240
21299
|
var richTextToolbarButtonActive = css97`
|
|
21241
21300
|
background: var(--gray-200);
|
|
21242
21301
|
`;
|
|
21302
|
+
var textStyleButton = css97`
|
|
21303
|
+
justify-content: space-between;
|
|
21304
|
+
min-width: 7rem;
|
|
21305
|
+
`;
|
|
21243
21306
|
var toolbarIcon = css97`
|
|
21244
21307
|
color: inherit;
|
|
21245
21308
|
`;
|
|
@@ -21260,7 +21323,7 @@ var FORMATS_WITH_ICON = /* @__PURE__ */ new Map([
|
|
|
21260
21323
|
]);
|
|
21261
21324
|
var HEADING_ELEMENTS = ["h1", "h2", "h3", "h4", "h5", "h6"];
|
|
21262
21325
|
var TEXTUAL_ELEMENTS = HEADING_ELEMENTS;
|
|
21263
|
-
var RichTextToolbar = ({ config, customControls }) => {
|
|
21326
|
+
var RichTextToolbar = ({ config, customControls, onInsertTable }) => {
|
|
21264
21327
|
const [editor] = useLexicalComposerContext4();
|
|
21265
21328
|
const {
|
|
21266
21329
|
activeElement,
|
|
@@ -21276,26 +21339,39 @@ var RichTextToolbar = ({ config, customControls }) => {
|
|
|
21276
21339
|
visibleLists,
|
|
21277
21340
|
codeElementVisible,
|
|
21278
21341
|
quoteElementVisible,
|
|
21279
|
-
visibleElementsWithIcons
|
|
21342
|
+
visibleElementsWithIcons,
|
|
21343
|
+
visibleInsertElementsWithIcons,
|
|
21344
|
+
tableElementVisible
|
|
21280
21345
|
} = useRichTextToolbarState({ config });
|
|
21281
21346
|
const onSelectElement = (type) => {
|
|
21282
21347
|
if (activeElement === type) {
|
|
21283
21348
|
return;
|
|
21284
21349
|
}
|
|
21285
|
-
editor.
|
|
21286
|
-
|
|
21287
|
-
|
|
21288
|
-
|
|
21289
|
-
|
|
21290
|
-
|
|
21291
|
-
|
|
21292
|
-
|
|
21293
|
-
|
|
21294
|
-
|
|
21295
|
-
|
|
21296
|
-
|
|
21297
|
-
|
|
21298
|
-
|
|
21350
|
+
editor.focus(() => {
|
|
21351
|
+
editor.update(() => {
|
|
21352
|
+
const selection = $getSelection3();
|
|
21353
|
+
if (HEADING_ELEMENTS.includes(type)) {
|
|
21354
|
+
$setBlocksType(selection, () => $createHeadingNode(type));
|
|
21355
|
+
} else if (type === "paragraph") {
|
|
21356
|
+
$setBlocksType(selection, () => $createParagraphNode());
|
|
21357
|
+
} else if (type === "quote") {
|
|
21358
|
+
$setBlocksType(selection, () => $createQuoteNode());
|
|
21359
|
+
} else if (type === "code") {
|
|
21360
|
+
$setBlocksType(selection, () => $createCodeNode());
|
|
21361
|
+
} else if (type === "table" && onInsertTable) {
|
|
21362
|
+
onInsertTable().then((dimensions) => {
|
|
21363
|
+
if (!dimensions) {
|
|
21364
|
+
return;
|
|
21365
|
+
}
|
|
21366
|
+
const { rows, columns } = dimensions;
|
|
21367
|
+
editor.focus(() => {
|
|
21368
|
+
editor.update(() => {
|
|
21369
|
+
$setBlocksType(selection, () => $createTableNodeWithDimensions(rows, columns, false));
|
|
21370
|
+
});
|
|
21371
|
+
});
|
|
21372
|
+
});
|
|
21373
|
+
}
|
|
21374
|
+
});
|
|
21299
21375
|
});
|
|
21300
21376
|
};
|
|
21301
21377
|
const updateToolbar = useCallback11(() => {
|
|
@@ -21360,8 +21436,7 @@ var RichTextToolbar = ({ config, customControls }) => {
|
|
|
21360
21436
|
/* @__PURE__ */ jsxs86(
|
|
21361
21437
|
Menu,
|
|
21362
21438
|
{
|
|
21363
|
-
|
|
21364
|
-
menuTrigger: /* @__PURE__ */ jsxs86("button", { css: richTextToolbarButton, title: "Text styles", children: [
|
|
21439
|
+
menuTrigger: /* @__PURE__ */ jsxs86("button", { css: [richTextToolbarButton, textStyleButton], title: "Text styles", children: [
|
|
21365
21440
|
visibleTextualElements.some((element) => element.type === activeElement) ? getLabelForElement(activeElement) : getLabelForElement("paragraph"),
|
|
21366
21441
|
" ",
|
|
21367
21442
|
/* @__PURE__ */ jsx130(Icon, { icon: "chevron-down", css: [toolbarIcon, toolbarChevron], size: "1rem" })
|
|
@@ -21421,7 +21496,7 @@ var RichTextToolbar = ({ config, customControls }) => {
|
|
|
21421
21496
|
}
|
|
21422
21497
|
) : null
|
|
21423
21498
|
] }) : null,
|
|
21424
|
-
visibleElementsWithIcons.size > 0 ? /* @__PURE__ */ jsxs86("div", { css: toolbarGroup, children: [
|
|
21499
|
+
visibleElementsWithIcons.size > 0 || customControls ? /* @__PURE__ */ jsxs86("div", { css: toolbarGroup, children: [
|
|
21425
21500
|
linkElementVisible ? /* @__PURE__ */ jsx130(Tooltip, { title: "Link", placement: "top", children: /* @__PURE__ */ jsx130(
|
|
21426
21501
|
"button",
|
|
21427
21502
|
{
|
|
@@ -21460,28 +21535,50 @@ var RichTextToolbar = ({ config, customControls }) => {
|
|
|
21460
21535
|
}
|
|
21461
21536
|
) }) : null
|
|
21462
21537
|
] }) : null,
|
|
21463
|
-
|
|
21464
|
-
"button",
|
|
21465
|
-
{
|
|
21466
|
-
onClick: () => {
|
|
21467
|
-
activeElement === "quote" ? onSelectElement("paragraph") : onSelectElement("quote");
|
|
21468
|
-
},
|
|
21469
|
-
css: [richTextToolbarButton, activeElement === "quote" ? richTextToolbarButtonActive : null],
|
|
21470
|
-
children: /* @__PURE__ */ jsx130(RichTextToolbarIcon, { icon: "quote" })
|
|
21471
|
-
}
|
|
21472
|
-
) }) : null,
|
|
21473
|
-
codeElementVisible ? /* @__PURE__ */ jsx130(Tooltip, { title: "Code Block", placement: "top", children: /* @__PURE__ */ jsx130(
|
|
21474
|
-
"button",
|
|
21475
|
-
{
|
|
21476
|
-
onClick: () => {
|
|
21477
|
-
activeElement === "code" ? onSelectElement("paragraph") : onSelectElement("code");
|
|
21478
|
-
},
|
|
21479
|
-
css: [richTextToolbarButton, activeElement === "code" ? richTextToolbarButtonActive : null],
|
|
21480
|
-
children: /* @__PURE__ */ jsx130(RichTextToolbarIcon, { icon: "code-slash" })
|
|
21481
|
-
}
|
|
21482
|
-
) }) : null
|
|
21538
|
+
customControls ? customControls : null
|
|
21483
21539
|
] }) : null,
|
|
21484
|
-
|
|
21540
|
+
visibleInsertElementsWithIcons.size > 0 ? /* @__PURE__ */ jsx130("div", { css: toolbarGroup, children: /* @__PURE__ */ jsxs86(
|
|
21541
|
+
Menu,
|
|
21542
|
+
{
|
|
21543
|
+
menuTrigger: /* @__PURE__ */ jsxs86("button", { css: richTextToolbarButton, title: "Insert block element", children: [
|
|
21544
|
+
"Insert",
|
|
21545
|
+
/* @__PURE__ */ jsx130(Icon, { icon: "chevron-down", css: [toolbarIcon, toolbarChevron], size: "1rem" })
|
|
21546
|
+
] }),
|
|
21547
|
+
placement: "bottom-start",
|
|
21548
|
+
children: [
|
|
21549
|
+
quoteElementVisible ? /* @__PURE__ */ jsx130(
|
|
21550
|
+
MenuItem,
|
|
21551
|
+
{
|
|
21552
|
+
onClick: () => {
|
|
21553
|
+
onSelectElement("quote");
|
|
21554
|
+
},
|
|
21555
|
+
icon: /* @__PURE__ */ jsx130(Icon, { icon: "quote", iconColor: "currentColor" }),
|
|
21556
|
+
children: "Quote"
|
|
21557
|
+
}
|
|
21558
|
+
) : null,
|
|
21559
|
+
codeElementVisible ? /* @__PURE__ */ jsx130(
|
|
21560
|
+
MenuItem,
|
|
21561
|
+
{
|
|
21562
|
+
onClick: () => {
|
|
21563
|
+
onSelectElement("code");
|
|
21564
|
+
},
|
|
21565
|
+
icon: /* @__PURE__ */ jsx130(Icon, { icon: "code-slash", iconColor: "currentColor" }),
|
|
21566
|
+
children: "Code"
|
|
21567
|
+
}
|
|
21568
|
+
) : null,
|
|
21569
|
+
tableElementVisible && onInsertTable !== void 0 ? /* @__PURE__ */ jsx130(
|
|
21570
|
+
MenuItem,
|
|
21571
|
+
{
|
|
21572
|
+
onClick: () => {
|
|
21573
|
+
onSelectElement("table");
|
|
21574
|
+
},
|
|
21575
|
+
icon: /* @__PURE__ */ jsx130(Icon, { icon: "view-grid", iconColor: "currentColor" }),
|
|
21576
|
+
children: "Table"
|
|
21577
|
+
}
|
|
21578
|
+
) : null
|
|
21579
|
+
]
|
|
21580
|
+
}
|
|
21581
|
+
) }) : null
|
|
21485
21582
|
] });
|
|
21486
21583
|
};
|
|
21487
21584
|
var RichTextToolbar_default = RichTextToolbar;
|
|
@@ -21558,6 +21655,9 @@ var useRichTextToolbarState = ({ config }) => {
|
|
|
21558
21655
|
const codeElementVisible = useMemo6(() => {
|
|
21559
21656
|
return enabledBuiltInElements.some((element) => element.type === "code") || activeElement === "code";
|
|
21560
21657
|
}, [activeElement, enabledBuiltInElements]);
|
|
21658
|
+
const tableElementVisible = useMemo6(() => {
|
|
21659
|
+
return enabledBuiltInElements.some((element) => element.type === "table") || activeElement === "table";
|
|
21660
|
+
}, [activeElement, enabledBuiltInElements]);
|
|
21561
21661
|
const visibleElementsWithIcons = useMemo6(() => {
|
|
21562
21662
|
const visibleElements = /* @__PURE__ */ new Set();
|
|
21563
21663
|
if (linkElementVisible) {
|
|
@@ -21568,14 +21668,21 @@ var useRichTextToolbarState = ({ config }) => {
|
|
|
21568
21668
|
visibleElements.add(type);
|
|
21569
21669
|
});
|
|
21570
21670
|
}
|
|
21671
|
+
return visibleElements;
|
|
21672
|
+
}, [linkElementVisible, visibleLists]);
|
|
21673
|
+
const visibleInsertElementsWithIcons = useMemo6(() => {
|
|
21674
|
+
const visibleElements = /* @__PURE__ */ new Set();
|
|
21571
21675
|
if (quoteElementVisible) {
|
|
21572
21676
|
visibleElements.add("quote");
|
|
21573
21677
|
}
|
|
21574
21678
|
if (codeElementVisible) {
|
|
21575
21679
|
visibleElements.add("code");
|
|
21576
21680
|
}
|
|
21681
|
+
if (tableElementVisible) {
|
|
21682
|
+
visibleElements.add("table");
|
|
21683
|
+
}
|
|
21577
21684
|
return visibleElements;
|
|
21578
|
-
}, [codeElementVisible,
|
|
21685
|
+
}, [codeElementVisible, quoteElementVisible, tableElementVisible]);
|
|
21579
21686
|
return {
|
|
21580
21687
|
activeFormats,
|
|
21581
21688
|
setActiveFormats,
|
|
@@ -21590,12 +21697,718 @@ var useRichTextToolbarState = ({ config }) => {
|
|
|
21590
21697
|
visibleLists,
|
|
21591
21698
|
quoteElementVisible,
|
|
21592
21699
|
codeElementVisible,
|
|
21593
|
-
|
|
21700
|
+
tableElementVisible,
|
|
21701
|
+
visibleElementsWithIcons,
|
|
21702
|
+
visibleInsertElementsWithIcons
|
|
21594
21703
|
};
|
|
21595
21704
|
};
|
|
21596
21705
|
|
|
21706
|
+
// src/components/ParameterInputs/rich-text/TableActionMenuPlugin.tsx
|
|
21707
|
+
import { css as css98 } from "@emotion/react";
|
|
21708
|
+
import { useLexicalComposerContext as useLexicalComposerContext5 } from "@lexical/react/LexicalComposerContext";
|
|
21709
|
+
import { useLexicalEditable } from "@lexical/react/useLexicalEditable";
|
|
21710
|
+
import {
|
|
21711
|
+
$deleteTableColumn__EXPERIMENTAL,
|
|
21712
|
+
$deleteTableRow__EXPERIMENTAL,
|
|
21713
|
+
$getTableCellNodeFromLexicalNode,
|
|
21714
|
+
$getTableColumnIndexFromTableCellNode,
|
|
21715
|
+
$getTableNodeFromLexicalNodeOrThrow,
|
|
21716
|
+
$getTableRowIndexFromTableCellNode,
|
|
21717
|
+
$insertTableColumn__EXPERIMENTAL,
|
|
21718
|
+
$insertTableRow__EXPERIMENTAL,
|
|
21719
|
+
$isTableCellNode,
|
|
21720
|
+
$isTableRowNode,
|
|
21721
|
+
$isTableSelection,
|
|
21722
|
+
getTableObserverFromTableElement,
|
|
21723
|
+
TableCellHeaderStates,
|
|
21724
|
+
TableCellNode
|
|
21725
|
+
} from "@lexical/table";
|
|
21726
|
+
import { $getRoot, $getSelection as $getSelection4, $isRangeSelection as $isRangeSelection4 } from "lexical";
|
|
21727
|
+
import { forwardRef as forwardRef22, useCallback as useCallback12, useEffect as useEffect21, useLayoutEffect, useState as useState18 } from "react";
|
|
21728
|
+
import { jsx as jsx131, jsxs as jsxs87 } from "@emotion/react/jsx-runtime";
|
|
21729
|
+
function computeSelectionCount(selection) {
|
|
21730
|
+
const selectionShape = selection.getShape();
|
|
21731
|
+
return {
|
|
21732
|
+
columns: selectionShape.toX - selectionShape.fromX + 1,
|
|
21733
|
+
rows: selectionShape.toY - selectionShape.fromY + 1
|
|
21734
|
+
};
|
|
21735
|
+
}
|
|
21736
|
+
var tableActionMenuTrigger = css98`
|
|
21737
|
+
position: absolute;
|
|
21738
|
+
transform: translate(calc(-100% - 1px), 1px);
|
|
21739
|
+
`;
|
|
21740
|
+
var TableActionMenuTrigger = forwardRef22((props, ref) => {
|
|
21741
|
+
const { tableCellEl, positioningAnchorEl, ...rest } = props;
|
|
21742
|
+
const [coordinates, setCoordinates] = useState18({ x: 0, y: 0 });
|
|
21743
|
+
useLayoutEffect(() => {
|
|
21744
|
+
const rect = tableCellEl.getBoundingClientRect();
|
|
21745
|
+
const parentRect = positioningAnchorEl.getBoundingClientRect();
|
|
21746
|
+
const relativeX = rect.right - parentRect.left;
|
|
21747
|
+
const relativeY = rect.top - parentRect.top;
|
|
21748
|
+
setCoordinates({ x: relativeX, y: relativeY });
|
|
21749
|
+
}, [tableCellEl, positioningAnchorEl]);
|
|
21750
|
+
return /* @__PURE__ */ jsx131(
|
|
21751
|
+
IconButton,
|
|
21752
|
+
{
|
|
21753
|
+
ref,
|
|
21754
|
+
css: [
|
|
21755
|
+
tableActionMenuTrigger,
|
|
21756
|
+
{
|
|
21757
|
+
top: coordinates.y,
|
|
21758
|
+
left: coordinates.x
|
|
21759
|
+
}
|
|
21760
|
+
],
|
|
21761
|
+
size: "xs",
|
|
21762
|
+
buttonType: "unimportant",
|
|
21763
|
+
...rest,
|
|
21764
|
+
children: /* @__PURE__ */ jsx131(Icon, { icon: "chevron-down", size: "1rem", iconColor: "currentColor" })
|
|
21765
|
+
}
|
|
21766
|
+
);
|
|
21767
|
+
});
|
|
21768
|
+
TableActionMenuTrigger.displayName = "TableActionMenuTrigger";
|
|
21769
|
+
function TableActionMenu({
|
|
21770
|
+
tableCellNode: _tableCellNode,
|
|
21771
|
+
menuPortalEl,
|
|
21772
|
+
tableCellEl,
|
|
21773
|
+
positioningAnchorEl
|
|
21774
|
+
}) {
|
|
21775
|
+
const [editor] = useLexicalComposerContext5();
|
|
21776
|
+
const [tableCellNode, updateTableCellNode] = useState18(_tableCellNode);
|
|
21777
|
+
const [selectionCounts, updateSelectionCounts] = useState18({
|
|
21778
|
+
columns: 1,
|
|
21779
|
+
rows: 1
|
|
21780
|
+
});
|
|
21781
|
+
const [menuTriggerKey, setMenuTriggerKey] = useState18(0);
|
|
21782
|
+
const incrementMenuTriggerKey = () => {
|
|
21783
|
+
setMenuTriggerKey((key) => key += 1);
|
|
21784
|
+
};
|
|
21785
|
+
useEffect21(() => {
|
|
21786
|
+
return editor.registerMutationListener(
|
|
21787
|
+
TableCellNode,
|
|
21788
|
+
(nodeMutations) => {
|
|
21789
|
+
const nodeUpdated = nodeMutations.get(tableCellNode.getKey()) === "updated";
|
|
21790
|
+
if (nodeUpdated) {
|
|
21791
|
+
editor.getEditorState().read(() => {
|
|
21792
|
+
updateTableCellNode(tableCellNode.getLatest());
|
|
21793
|
+
});
|
|
21794
|
+
}
|
|
21795
|
+
},
|
|
21796
|
+
{ skipInitialization: true }
|
|
21797
|
+
);
|
|
21798
|
+
}, [editor, tableCellNode]);
|
|
21799
|
+
useEffect21(() => {
|
|
21800
|
+
editor.getEditorState().read(() => {
|
|
21801
|
+
const selection = $getSelection4();
|
|
21802
|
+
if ($isTableSelection(selection)) {
|
|
21803
|
+
updateSelectionCounts(computeSelectionCount(selection));
|
|
21804
|
+
}
|
|
21805
|
+
});
|
|
21806
|
+
}, [editor]);
|
|
21807
|
+
const clearTableSelection = useCallback12(() => {
|
|
21808
|
+
editor.update(() => {
|
|
21809
|
+
if (tableCellNode.isAttached()) {
|
|
21810
|
+
const tableNode = $getTableNodeFromLexicalNodeOrThrow(tableCellNode);
|
|
21811
|
+
const tableElement2 = editor.getElementByKey(
|
|
21812
|
+
tableNode.getKey()
|
|
21813
|
+
);
|
|
21814
|
+
if (!tableElement2) {
|
|
21815
|
+
throw new Error("Expected to find tableElement in DOM");
|
|
21816
|
+
}
|
|
21817
|
+
const tableSelection = getTableObserverFromTableElement(tableElement2);
|
|
21818
|
+
if (tableSelection !== null) {
|
|
21819
|
+
tableSelection.clearHighlight();
|
|
21820
|
+
}
|
|
21821
|
+
tableNode.markDirty();
|
|
21822
|
+
updateTableCellNode(tableCellNode.getLatest());
|
|
21823
|
+
}
|
|
21824
|
+
const rootNode = $getRoot();
|
|
21825
|
+
rootNode.selectStart();
|
|
21826
|
+
});
|
|
21827
|
+
}, [editor, tableCellNode]);
|
|
21828
|
+
const insertTableRowAtSelection = useCallback12(
|
|
21829
|
+
(shouldInsertAfter) => {
|
|
21830
|
+
editor.update(() => {
|
|
21831
|
+
$insertTableRow__EXPERIMENTAL(shouldInsertAfter);
|
|
21832
|
+
});
|
|
21833
|
+
incrementMenuTriggerKey();
|
|
21834
|
+
},
|
|
21835
|
+
[editor]
|
|
21836
|
+
);
|
|
21837
|
+
const insertTableColumnAtSelection = useCallback12(
|
|
21838
|
+
(shouldInsertAfter) => {
|
|
21839
|
+
editor.update(() => {
|
|
21840
|
+
for (let i = 0; i < selectionCounts.columns; i++) {
|
|
21841
|
+
$insertTableColumn__EXPERIMENTAL(shouldInsertAfter);
|
|
21842
|
+
}
|
|
21843
|
+
});
|
|
21844
|
+
incrementMenuTriggerKey();
|
|
21845
|
+
},
|
|
21846
|
+
[editor, selectionCounts.columns]
|
|
21847
|
+
);
|
|
21848
|
+
const deleteTableRowAtSelection = useCallback12(() => {
|
|
21849
|
+
editor.update(() => {
|
|
21850
|
+
$deleteTableRow__EXPERIMENTAL();
|
|
21851
|
+
});
|
|
21852
|
+
incrementMenuTriggerKey();
|
|
21853
|
+
}, [editor]);
|
|
21854
|
+
const deleteTableAtSelection = useCallback12(() => {
|
|
21855
|
+
editor.update(() => {
|
|
21856
|
+
const tableNode = $getTableNodeFromLexicalNodeOrThrow(tableCellNode);
|
|
21857
|
+
tableNode.remove();
|
|
21858
|
+
clearTableSelection();
|
|
21859
|
+
});
|
|
21860
|
+
}, [editor, tableCellNode, clearTableSelection]);
|
|
21861
|
+
const deleteTableColumnAtSelection = useCallback12(() => {
|
|
21862
|
+
editor.update(() => {
|
|
21863
|
+
$deleteTableColumn__EXPERIMENTAL();
|
|
21864
|
+
clearTableSelection();
|
|
21865
|
+
});
|
|
21866
|
+
incrementMenuTriggerKey();
|
|
21867
|
+
}, [editor, clearTableSelection]);
|
|
21868
|
+
const toggleTableRowIsHeader = useCallback12(() => {
|
|
21869
|
+
editor.update(() => {
|
|
21870
|
+
const tableNode = $getTableNodeFromLexicalNodeOrThrow(tableCellNode);
|
|
21871
|
+
const tableRowIndex = $getTableRowIndexFromTableCellNode(tableCellNode);
|
|
21872
|
+
const tableRows = tableNode.getChildren();
|
|
21873
|
+
if (tableRowIndex >= tableRows.length || tableRowIndex < 0) {
|
|
21874
|
+
throw new Error("Expected table cell to be inside of table row.");
|
|
21875
|
+
}
|
|
21876
|
+
const tableRow2 = tableRows[tableRowIndex];
|
|
21877
|
+
if (!$isTableRowNode(tableRow2)) {
|
|
21878
|
+
throw new Error("Expected table row");
|
|
21879
|
+
}
|
|
21880
|
+
tableRow2.getChildren().forEach((tableCell) => {
|
|
21881
|
+
if (!$isTableCellNode(tableCell)) {
|
|
21882
|
+
throw new Error("Expected table cell");
|
|
21883
|
+
}
|
|
21884
|
+
tableCell.toggleHeaderStyle(TableCellHeaderStates.ROW);
|
|
21885
|
+
});
|
|
21886
|
+
clearTableSelection();
|
|
21887
|
+
});
|
|
21888
|
+
}, [editor, tableCellNode, clearTableSelection]);
|
|
21889
|
+
const toggleTableColumnIsHeader = useCallback12(() => {
|
|
21890
|
+
editor.update(() => {
|
|
21891
|
+
const tableNode = $getTableNodeFromLexicalNodeOrThrow(tableCellNode);
|
|
21892
|
+
const tableColumnIndex = $getTableColumnIndexFromTableCellNode(tableCellNode);
|
|
21893
|
+
const tableRows = tableNode.getChildren();
|
|
21894
|
+
const maxRowsLength = Math.max(...tableRows.map((row) => row.getChildren().length));
|
|
21895
|
+
if (tableColumnIndex >= maxRowsLength || tableColumnIndex < 0) {
|
|
21896
|
+
throw new Error("Expected table cell to be inside of table row.");
|
|
21897
|
+
}
|
|
21898
|
+
for (let r = 0; r < tableRows.length; r++) {
|
|
21899
|
+
const tableRow2 = tableRows[r];
|
|
21900
|
+
if (!$isTableRowNode(tableRow2)) {
|
|
21901
|
+
throw new Error("Expected table row");
|
|
21902
|
+
}
|
|
21903
|
+
const tableCells = tableRow2.getChildren();
|
|
21904
|
+
if (tableColumnIndex >= tableCells.length) {
|
|
21905
|
+
continue;
|
|
21906
|
+
}
|
|
21907
|
+
const tableCell = tableCells[tableColumnIndex];
|
|
21908
|
+
if (!$isTableCellNode(tableCell)) {
|
|
21909
|
+
throw new Error("Expected table cell");
|
|
21910
|
+
}
|
|
21911
|
+
tableCell.toggleHeaderStyle(TableCellHeaderStates.COLUMN);
|
|
21912
|
+
}
|
|
21913
|
+
clearTableSelection();
|
|
21914
|
+
});
|
|
21915
|
+
}, [editor, tableCellNode, clearTableSelection]);
|
|
21916
|
+
const menuItemCss = css98({
|
|
21917
|
+
fontSize: "var(--fs-sm)"
|
|
21918
|
+
});
|
|
21919
|
+
return /* @__PURE__ */ jsxs87(
|
|
21920
|
+
Menu,
|
|
21921
|
+
{
|
|
21922
|
+
menuTrigger: /* @__PURE__ */ jsx131(
|
|
21923
|
+
TableActionMenuTrigger,
|
|
21924
|
+
{
|
|
21925
|
+
tableCellEl,
|
|
21926
|
+
positioningAnchorEl
|
|
21927
|
+
},
|
|
21928
|
+
menuTriggerKey
|
|
21929
|
+
),
|
|
21930
|
+
portalElement: menuPortalEl,
|
|
21931
|
+
maxMenuHeight: "300px",
|
|
21932
|
+
children: [
|
|
21933
|
+
/* @__PURE__ */ jsxs87(
|
|
21934
|
+
MenuItem,
|
|
21935
|
+
{
|
|
21936
|
+
onClick: () => {
|
|
21937
|
+
insertTableRowAtSelection(false);
|
|
21938
|
+
},
|
|
21939
|
+
css: menuItemCss,
|
|
21940
|
+
children: [
|
|
21941
|
+
"Insert ",
|
|
21942
|
+
selectionCounts.rows === 1 ? "row" : `${selectionCounts.rows} rows`,
|
|
21943
|
+
" above"
|
|
21944
|
+
]
|
|
21945
|
+
}
|
|
21946
|
+
),
|
|
21947
|
+
/* @__PURE__ */ jsxs87(MenuItem, { onClick: () => insertTableRowAtSelection(true), css: menuItemCss, children: [
|
|
21948
|
+
"Insert ",
|
|
21949
|
+
selectionCounts.rows === 1 ? "row" : `${selectionCounts.rows} rows`,
|
|
21950
|
+
" below"
|
|
21951
|
+
] }),
|
|
21952
|
+
/* @__PURE__ */ jsx131(MenuItemSeparator, {}),
|
|
21953
|
+
/* @__PURE__ */ jsxs87(MenuItem, { onClick: () => insertTableColumnAtSelection(false), css: menuItemCss, children: [
|
|
21954
|
+
"Insert ",
|
|
21955
|
+
selectionCounts.columns === 1 ? "column" : `${selectionCounts.columns} columns`,
|
|
21956
|
+
" left"
|
|
21957
|
+
] }),
|
|
21958
|
+
/* @__PURE__ */ jsxs87(MenuItem, { onClick: () => insertTableColumnAtSelection(true), css: menuItemCss, children: [
|
|
21959
|
+
"Insert ",
|
|
21960
|
+
selectionCounts.columns === 1 ? "column" : `${selectionCounts.columns} columns`,
|
|
21961
|
+
" right"
|
|
21962
|
+
] }),
|
|
21963
|
+
/* @__PURE__ */ jsx131(MenuItemSeparator, {}),
|
|
21964
|
+
/* @__PURE__ */ jsx131(MenuItem, { onClick: () => deleteTableColumnAtSelection(), css: menuItemCss, children: "Delete column" }),
|
|
21965
|
+
/* @__PURE__ */ jsx131(MenuItem, { onClick: () => deleteTableRowAtSelection(), css: menuItemCss, children: "Delete row" }),
|
|
21966
|
+
/* @__PURE__ */ jsx131(MenuItem, { onClick: () => deleteTableAtSelection(), css: menuItemCss, children: "Delete table" }),
|
|
21967
|
+
/* @__PURE__ */ jsx131(MenuItemSeparator, {}),
|
|
21968
|
+
/* @__PURE__ */ jsxs87(MenuItem, { onClick: () => toggleTableRowIsHeader(), css: menuItemCss, children: [
|
|
21969
|
+
(tableCellNode.__headerState & TableCellHeaderStates.ROW) === TableCellHeaderStates.ROW ? "Remove" : "Add",
|
|
21970
|
+
" ",
|
|
21971
|
+
"row header"
|
|
21972
|
+
] }),
|
|
21973
|
+
/* @__PURE__ */ jsxs87(MenuItem, { onClick: () => toggleTableColumnIsHeader(), css: menuItemCss, children: [
|
|
21974
|
+
(tableCellNode.__headerState & TableCellHeaderStates.COLUMN) === TableCellHeaderStates.COLUMN ? "Remove" : "Add",
|
|
21975
|
+
" ",
|
|
21976
|
+
"column header"
|
|
21977
|
+
] })
|
|
21978
|
+
]
|
|
21979
|
+
}
|
|
21980
|
+
);
|
|
21981
|
+
}
|
|
21982
|
+
function TableCellActionMenuContainer({
|
|
21983
|
+
menuPortalEl,
|
|
21984
|
+
positioningAnchorEl
|
|
21985
|
+
}) {
|
|
21986
|
+
const [editor] = useLexicalComposerContext5();
|
|
21987
|
+
const [tableCellNode, setTableMenuCellNode] = useState18(null);
|
|
21988
|
+
const [tableCellNodeEl, _setTableMenuCellNodeEl] = useState18(null);
|
|
21989
|
+
const [tableCellMenuPortalEl, setTableMenuCellMenuPortalEl] = useState18(null);
|
|
21990
|
+
useEffect21(() => {
|
|
21991
|
+
const newPortalEl = document.createElement("div");
|
|
21992
|
+
setTableMenuCellMenuPortalEl(newPortalEl);
|
|
21993
|
+
menuPortalEl.appendChild(newPortalEl);
|
|
21994
|
+
return () => {
|
|
21995
|
+
newPortalEl.remove();
|
|
21996
|
+
};
|
|
21997
|
+
}, [menuPortalEl]);
|
|
21998
|
+
const setTableMenuCellNodeElem = useCallback12((elem) => {
|
|
21999
|
+
if (elem) {
|
|
22000
|
+
_setTableMenuCellNodeEl(elem);
|
|
22001
|
+
} else {
|
|
22002
|
+
_setTableMenuCellNodeEl(null);
|
|
22003
|
+
}
|
|
22004
|
+
}, []);
|
|
22005
|
+
const $moveMenu = useCallback12(() => {
|
|
22006
|
+
const selection = $getSelection4();
|
|
22007
|
+
const nativeSelection = window.getSelection();
|
|
22008
|
+
const activeElement = document.activeElement;
|
|
22009
|
+
if (selection == null) {
|
|
22010
|
+
setTableMenuCellNode(null);
|
|
22011
|
+
return;
|
|
22012
|
+
}
|
|
22013
|
+
const rootElement = editor.getRootElement();
|
|
22014
|
+
if ($isRangeSelection4(selection) && rootElement !== null && nativeSelection !== null && rootElement.contains(nativeSelection.anchorNode)) {
|
|
22015
|
+
const tableCellNodeFromSelection = $getTableCellNodeFromLexicalNode(selection.anchor.getNode());
|
|
22016
|
+
if (tableCellNodeFromSelection == null) {
|
|
22017
|
+
setTableMenuCellNode(null);
|
|
22018
|
+
setTableMenuCellNodeElem(null);
|
|
22019
|
+
return;
|
|
22020
|
+
}
|
|
22021
|
+
const tableCellParentNodeDOM = editor.getElementByKey(tableCellNodeFromSelection.getKey());
|
|
22022
|
+
if (tableCellParentNodeDOM == null) {
|
|
22023
|
+
setTableMenuCellNode(null);
|
|
22024
|
+
setTableMenuCellNodeElem(null);
|
|
22025
|
+
return;
|
|
22026
|
+
}
|
|
22027
|
+
setTableMenuCellNode(tableCellNodeFromSelection);
|
|
22028
|
+
setTableMenuCellNodeElem(tableCellParentNodeDOM);
|
|
22029
|
+
} else if (!activeElement) {
|
|
22030
|
+
setTableMenuCellNode(null);
|
|
22031
|
+
setTableMenuCellNodeElem(null);
|
|
22032
|
+
}
|
|
22033
|
+
}, [editor, setTableMenuCellNodeElem]);
|
|
22034
|
+
useEffect21(() => {
|
|
22035
|
+
return editor.registerUpdateListener(() => {
|
|
22036
|
+
editor.getEditorState().read(() => {
|
|
22037
|
+
$moveMenu();
|
|
22038
|
+
});
|
|
22039
|
+
});
|
|
22040
|
+
});
|
|
22041
|
+
return tableCellNode != null && tableCellNodeEl != null && tableCellMenuPortalEl != null && /* @__PURE__ */ jsx131(
|
|
22042
|
+
TableActionMenu,
|
|
22043
|
+
{
|
|
22044
|
+
tableCellNode,
|
|
22045
|
+
menuPortalEl: tableCellMenuPortalEl,
|
|
22046
|
+
tableCellEl: tableCellNodeEl,
|
|
22047
|
+
positioningAnchorEl
|
|
22048
|
+
},
|
|
22049
|
+
tableCellNode.getKey()
|
|
22050
|
+
);
|
|
22051
|
+
}
|
|
22052
|
+
function TableActionMenuPlugin({ positioningAnchorEl }) {
|
|
22053
|
+
const isEditable = useLexicalEditable();
|
|
22054
|
+
return isEditable ? /* @__PURE__ */ jsx131(
|
|
22055
|
+
TableCellActionMenuContainer,
|
|
22056
|
+
{
|
|
22057
|
+
menuPortalEl: positioningAnchorEl,
|
|
22058
|
+
positioningAnchorEl
|
|
22059
|
+
}
|
|
22060
|
+
) : null;
|
|
22061
|
+
}
|
|
22062
|
+
|
|
22063
|
+
// src/components/ParameterInputs/rich-text/TableCellResizerPlugin.tsx
|
|
22064
|
+
import { css as css99 } from "@emotion/react";
|
|
22065
|
+
import { useLexicalComposerContext as useLexicalComposerContext6 } from "@lexical/react/LexicalComposerContext";
|
|
22066
|
+
import { useLexicalEditable as useLexicalEditable2 } from "@lexical/react/useLexicalEditable";
|
|
22067
|
+
import {
|
|
22068
|
+
$computeTableMapSkipCellCheck,
|
|
22069
|
+
$getTableNodeFromLexicalNodeOrThrow as $getTableNodeFromLexicalNodeOrThrow2,
|
|
22070
|
+
$getTableRowIndexFromTableCellNode as $getTableRowIndexFromTableCellNode2,
|
|
22071
|
+
$isTableCellNode as $isTableCellNode2,
|
|
22072
|
+
$isTableRowNode as $isTableRowNode2
|
|
22073
|
+
} from "@lexical/table";
|
|
22074
|
+
import { calculateZoomLevel } from "@lexical/utils";
|
|
22075
|
+
import { $getNearestNodeFromDOMNode } from "lexical";
|
|
22076
|
+
import { useCallback as useCallback13, useEffect as useEffect22, useMemo as useMemo7, useRef as useRef12, useState as useState19 } from "react";
|
|
22077
|
+
import { createPortal as createPortal3 } from "react-dom";
|
|
22078
|
+
import { Fragment as Fragment20, jsx as jsx132, jsxs as jsxs88 } from "@emotion/react/jsx-runtime";
|
|
22079
|
+
var MIN_ROW_HEIGHT = 33;
|
|
22080
|
+
var MIN_COLUMN_WIDTH = 50;
|
|
22081
|
+
var tableResizer = css99`
|
|
22082
|
+
position: absolute;
|
|
22083
|
+
z-index: var(--z-10);
|
|
22084
|
+
`;
|
|
22085
|
+
var fixedGetDOMCellFromTarget = (node) => {
|
|
22086
|
+
let currentNode = node;
|
|
22087
|
+
while (currentNode != null) {
|
|
22088
|
+
const nodeName = currentNode.nodeName;
|
|
22089
|
+
if (nodeName === "TD" || nodeName === "TH") {
|
|
22090
|
+
const cell2 = currentNode._cell;
|
|
22091
|
+
if (cell2 === void 0) {
|
|
22092
|
+
return {
|
|
22093
|
+
elem: currentNode
|
|
22094
|
+
};
|
|
22095
|
+
}
|
|
22096
|
+
return cell2;
|
|
22097
|
+
}
|
|
22098
|
+
currentNode = currentNode.parentNode;
|
|
22099
|
+
}
|
|
22100
|
+
return null;
|
|
22101
|
+
};
|
|
22102
|
+
function TableCellResizer({ editor, positioningAnchorEl }) {
|
|
22103
|
+
const targetRef = useRef12(null);
|
|
22104
|
+
const resizerRef = useRef12(null);
|
|
22105
|
+
const tableRectRef = useRef12(null);
|
|
22106
|
+
const mouseStartPosRef = useRef12(null);
|
|
22107
|
+
const [mouseCurrentPos, updateMouseCurrentPos] = useState19(null);
|
|
22108
|
+
const [activeCell, updateActiveCell] = useState19(null);
|
|
22109
|
+
const [isMouseDown, updateIsMouseDown] = useState19(false);
|
|
22110
|
+
const [draggingDirection, updateDraggingDirection] = useState19(null);
|
|
22111
|
+
const resetState = useCallback13(() => {
|
|
22112
|
+
updateActiveCell(null);
|
|
22113
|
+
targetRef.current = null;
|
|
22114
|
+
updateDraggingDirection(null);
|
|
22115
|
+
mouseStartPosRef.current = null;
|
|
22116
|
+
tableRectRef.current = null;
|
|
22117
|
+
}, []);
|
|
22118
|
+
const isMouseDownOnEvent = (event) => {
|
|
22119
|
+
return (event.buttons & 1) === 1;
|
|
22120
|
+
};
|
|
22121
|
+
useEffect22(() => {
|
|
22122
|
+
const onMouseMove = (event) => {
|
|
22123
|
+
setTimeout(() => {
|
|
22124
|
+
const target = event.target;
|
|
22125
|
+
if (draggingDirection) {
|
|
22126
|
+
updateMouseCurrentPos({
|
|
22127
|
+
x: event.clientX,
|
|
22128
|
+
y: event.clientY
|
|
22129
|
+
});
|
|
22130
|
+
return;
|
|
22131
|
+
}
|
|
22132
|
+
updateIsMouseDown(isMouseDownOnEvent(event));
|
|
22133
|
+
if (resizerRef.current && resizerRef.current.contains(target)) {
|
|
22134
|
+
return;
|
|
22135
|
+
}
|
|
22136
|
+
if (targetRef.current !== target) {
|
|
22137
|
+
targetRef.current = target;
|
|
22138
|
+
const cell2 = fixedGetDOMCellFromTarget(target);
|
|
22139
|
+
if (cell2 && activeCell !== cell2) {
|
|
22140
|
+
editor.update(() => {
|
|
22141
|
+
const tableCellNode = $getNearestNodeFromDOMNode(cell2.elem);
|
|
22142
|
+
if (!tableCellNode) {
|
|
22143
|
+
throw new Error("TableCellResizer: Table cell node not found.");
|
|
22144
|
+
}
|
|
22145
|
+
const tableNode = $getTableNodeFromLexicalNodeOrThrow2(tableCellNode);
|
|
22146
|
+
const tableElement2 = editor.getElementByKey(tableNode.getKey());
|
|
22147
|
+
if (!tableElement2) {
|
|
22148
|
+
throw new Error("TableCellResizer: Table element not found.");
|
|
22149
|
+
}
|
|
22150
|
+
targetRef.current = target;
|
|
22151
|
+
tableRectRef.current = tableElement2.getBoundingClientRect();
|
|
22152
|
+
updateActiveCell(cell2);
|
|
22153
|
+
});
|
|
22154
|
+
} else if (cell2 == null) {
|
|
22155
|
+
resetState();
|
|
22156
|
+
}
|
|
22157
|
+
}
|
|
22158
|
+
}, 0);
|
|
22159
|
+
};
|
|
22160
|
+
const onMouseDown = () => {
|
|
22161
|
+
setTimeout(() => {
|
|
22162
|
+
updateIsMouseDown(true);
|
|
22163
|
+
}, 0);
|
|
22164
|
+
};
|
|
22165
|
+
const onMouseUp = () => {
|
|
22166
|
+
setTimeout(() => {
|
|
22167
|
+
updateIsMouseDown(false);
|
|
22168
|
+
}, 0);
|
|
22169
|
+
};
|
|
22170
|
+
const removeRootListener = editor.registerRootListener((rootElement, prevRootElement) => {
|
|
22171
|
+
rootElement == null ? void 0 : rootElement.addEventListener("mousemove", onMouseMove);
|
|
22172
|
+
rootElement == null ? void 0 : rootElement.addEventListener("mousedown", onMouseDown);
|
|
22173
|
+
rootElement == null ? void 0 : rootElement.addEventListener("mouseup", onMouseUp);
|
|
22174
|
+
prevRootElement == null ? void 0 : prevRootElement.removeEventListener("mousemove", onMouseMove);
|
|
22175
|
+
prevRootElement == null ? void 0 : prevRootElement.removeEventListener("mousedown", onMouseDown);
|
|
22176
|
+
prevRootElement == null ? void 0 : prevRootElement.removeEventListener("mouseup", onMouseUp);
|
|
22177
|
+
});
|
|
22178
|
+
return () => {
|
|
22179
|
+
removeRootListener();
|
|
22180
|
+
};
|
|
22181
|
+
}, [activeCell, draggingDirection, editor, resetState]);
|
|
22182
|
+
const isHeightChanging = (direction) => {
|
|
22183
|
+
if (direction === "bottom") {
|
|
22184
|
+
return true;
|
|
22185
|
+
}
|
|
22186
|
+
return false;
|
|
22187
|
+
};
|
|
22188
|
+
const updateRowHeight = useCallback13(
|
|
22189
|
+
(heightChange) => {
|
|
22190
|
+
if (!activeCell) {
|
|
22191
|
+
throw new Error("TableCellResizer: Expected active cell.");
|
|
22192
|
+
}
|
|
22193
|
+
editor.update(
|
|
22194
|
+
() => {
|
|
22195
|
+
const tableCellNode = $getNearestNodeFromDOMNode(activeCell.elem);
|
|
22196
|
+
if (!$isTableCellNode2(tableCellNode)) {
|
|
22197
|
+
throw new Error("TableCellResizer: Table cell node not found.");
|
|
22198
|
+
}
|
|
22199
|
+
const tableNode = $getTableNodeFromLexicalNodeOrThrow2(tableCellNode);
|
|
22200
|
+
const tableRowIndex = $getTableRowIndexFromTableCellNode2(tableCellNode);
|
|
22201
|
+
const tableRows = tableNode.getChildren();
|
|
22202
|
+
if (tableRowIndex >= tableRows.length || tableRowIndex < 0) {
|
|
22203
|
+
throw new Error("Expected table cell to be inside of table row.");
|
|
22204
|
+
}
|
|
22205
|
+
const tableRow2 = tableRows[tableRowIndex];
|
|
22206
|
+
if (!$isTableRowNode2(tableRow2)) {
|
|
22207
|
+
throw new Error("Expected table row");
|
|
22208
|
+
}
|
|
22209
|
+
let height = tableRow2.getHeight();
|
|
22210
|
+
if (height === void 0) {
|
|
22211
|
+
const rowCells = tableRow2.getChildren();
|
|
22212
|
+
height = Math.min(...rowCells.map((cell2) => {
|
|
22213
|
+
var _a;
|
|
22214
|
+
return (_a = getCellNodeHeight(cell2, editor)) != null ? _a : Infinity;
|
|
22215
|
+
}));
|
|
22216
|
+
}
|
|
22217
|
+
const newHeight = Math.max(height + heightChange, MIN_ROW_HEIGHT);
|
|
22218
|
+
tableRow2.setHeight(newHeight);
|
|
22219
|
+
},
|
|
22220
|
+
{ tag: "skip-scroll-into-view" }
|
|
22221
|
+
);
|
|
22222
|
+
},
|
|
22223
|
+
[activeCell, editor]
|
|
22224
|
+
);
|
|
22225
|
+
const getCellNodeWidth = (cell2, activeEditor) => {
|
|
22226
|
+
const width = cell2.getWidth();
|
|
22227
|
+
if (width !== void 0) {
|
|
22228
|
+
return width;
|
|
22229
|
+
}
|
|
22230
|
+
const domCellNode = activeEditor.getElementByKey(cell2.getKey());
|
|
22231
|
+
if (domCellNode == null) {
|
|
22232
|
+
return void 0;
|
|
22233
|
+
}
|
|
22234
|
+
const computedStyle = getComputedStyle(domCellNode);
|
|
22235
|
+
return domCellNode.clientWidth - parseFloat(computedStyle.paddingLeft) - parseFloat(computedStyle.paddingRight);
|
|
22236
|
+
};
|
|
22237
|
+
const getCellNodeHeight = (cell2, activeEditor) => {
|
|
22238
|
+
const domCellNode = activeEditor.getElementByKey(cell2.getKey());
|
|
22239
|
+
return domCellNode == null ? void 0 : domCellNode.clientHeight;
|
|
22240
|
+
};
|
|
22241
|
+
const getCellColumnIndex = (tableCellNode, tableMap) => {
|
|
22242
|
+
for (let row = 0; row < tableMap.length; row++) {
|
|
22243
|
+
for (let column = 0; column < tableMap[row].length; column++) {
|
|
22244
|
+
if (tableMap[row][column].cell === tableCellNode) {
|
|
22245
|
+
return column;
|
|
22246
|
+
}
|
|
22247
|
+
}
|
|
22248
|
+
}
|
|
22249
|
+
};
|
|
22250
|
+
const updateColumnWidth = useCallback13(
|
|
22251
|
+
(widthChange) => {
|
|
22252
|
+
if (!activeCell) {
|
|
22253
|
+
throw new Error("TableCellResizer: Expected active cell.");
|
|
22254
|
+
}
|
|
22255
|
+
editor.update(
|
|
22256
|
+
() => {
|
|
22257
|
+
const tableCellNode = $getNearestNodeFromDOMNode(activeCell.elem);
|
|
22258
|
+
if (!$isTableCellNode2(tableCellNode)) {
|
|
22259
|
+
throw new Error("TableCellResizer: Table cell node not found.");
|
|
22260
|
+
}
|
|
22261
|
+
const tableNode = $getTableNodeFromLexicalNodeOrThrow2(tableCellNode);
|
|
22262
|
+
const [tableMap] = $computeTableMapSkipCellCheck(tableNode, null, null);
|
|
22263
|
+
const columnIndex = getCellColumnIndex(tableCellNode, tableMap);
|
|
22264
|
+
if (columnIndex === void 0) {
|
|
22265
|
+
throw new Error("TableCellResizer: Table column not found.");
|
|
22266
|
+
}
|
|
22267
|
+
for (let row = 0; row < tableMap.length; row++) {
|
|
22268
|
+
const cell2 = tableMap[row][columnIndex];
|
|
22269
|
+
if (cell2.startRow === row && (columnIndex === tableMap[row].length - 1 || tableMap[row][columnIndex].cell !== tableMap[row][columnIndex + 1].cell)) {
|
|
22270
|
+
const width = getCellNodeWidth(cell2.cell, editor);
|
|
22271
|
+
if (width === void 0) {
|
|
22272
|
+
continue;
|
|
22273
|
+
}
|
|
22274
|
+
const newWidth = Math.max(width + widthChange, MIN_COLUMN_WIDTH);
|
|
22275
|
+
cell2.cell.setWidth(newWidth);
|
|
22276
|
+
}
|
|
22277
|
+
}
|
|
22278
|
+
},
|
|
22279
|
+
{ tag: "skip-scroll-into-view" }
|
|
22280
|
+
);
|
|
22281
|
+
},
|
|
22282
|
+
[activeCell, editor]
|
|
22283
|
+
);
|
|
22284
|
+
const mouseUpHandler = useCallback13(
|
|
22285
|
+
(direction) => {
|
|
22286
|
+
const handler = (event) => {
|
|
22287
|
+
event.preventDefault();
|
|
22288
|
+
event.stopPropagation();
|
|
22289
|
+
if (!activeCell) {
|
|
22290
|
+
throw new Error("TableCellResizer: Expected active cell.");
|
|
22291
|
+
}
|
|
22292
|
+
if (mouseStartPosRef.current) {
|
|
22293
|
+
const { x, y } = mouseStartPosRef.current;
|
|
22294
|
+
if (activeCell === null) {
|
|
22295
|
+
return;
|
|
22296
|
+
}
|
|
22297
|
+
const zoom = calculateZoomLevel(event.target);
|
|
22298
|
+
if (isHeightChanging(direction)) {
|
|
22299
|
+
const heightChange = (event.clientY - y) / zoom;
|
|
22300
|
+
updateRowHeight(heightChange);
|
|
22301
|
+
} else {
|
|
22302
|
+
const widthChange = (event.clientX - x) / zoom;
|
|
22303
|
+
updateColumnWidth(widthChange);
|
|
22304
|
+
}
|
|
22305
|
+
resetState();
|
|
22306
|
+
document.removeEventListener("mouseup", handler);
|
|
22307
|
+
}
|
|
22308
|
+
};
|
|
22309
|
+
return handler;
|
|
22310
|
+
},
|
|
22311
|
+
[activeCell, resetState, updateColumnWidth, updateRowHeight]
|
|
22312
|
+
);
|
|
22313
|
+
const toggleResize = useCallback13(
|
|
22314
|
+
(direction) => (event) => {
|
|
22315
|
+
event.preventDefault();
|
|
22316
|
+
event.stopPropagation();
|
|
22317
|
+
if (!activeCell) {
|
|
22318
|
+
throw new Error("TableCellResizer: Expected active cell.");
|
|
22319
|
+
}
|
|
22320
|
+
mouseStartPosRef.current = {
|
|
22321
|
+
x: event.clientX,
|
|
22322
|
+
y: event.clientY
|
|
22323
|
+
};
|
|
22324
|
+
updateMouseCurrentPos(mouseStartPosRef.current);
|
|
22325
|
+
updateDraggingDirection(direction);
|
|
22326
|
+
document.addEventListener("mouseup", mouseUpHandler(direction));
|
|
22327
|
+
},
|
|
22328
|
+
[activeCell, mouseUpHandler]
|
|
22329
|
+
);
|
|
22330
|
+
const getResizers = useCallback13(() => {
|
|
22331
|
+
if (activeCell) {
|
|
22332
|
+
const { height, width, top, left } = activeCell.elem.getBoundingClientRect();
|
|
22333
|
+
const parentRect = positioningAnchorEl.getBoundingClientRect();
|
|
22334
|
+
const zoom = calculateZoomLevel(activeCell.elem);
|
|
22335
|
+
const zoneWidth = 10;
|
|
22336
|
+
const styles = {
|
|
22337
|
+
bottom: {
|
|
22338
|
+
backgroundColor: "none",
|
|
22339
|
+
cursor: "row-resize",
|
|
22340
|
+
height: `${zoneWidth}px`,
|
|
22341
|
+
left: `${left - parentRect.left}px`,
|
|
22342
|
+
top: `${top - parentRect.top + height - zoneWidth / 2}px`,
|
|
22343
|
+
width: `${width}px`
|
|
22344
|
+
},
|
|
22345
|
+
right: {
|
|
22346
|
+
backgroundColor: "none",
|
|
22347
|
+
cursor: "col-resize",
|
|
22348
|
+
height: `${height}px`,
|
|
22349
|
+
left: `${left - parentRect.left + width - zoneWidth / 2}px`,
|
|
22350
|
+
top: `${top - parentRect.top}px`,
|
|
22351
|
+
width: `${zoneWidth}px`
|
|
22352
|
+
}
|
|
22353
|
+
};
|
|
22354
|
+
const tableRect = tableRectRef.current;
|
|
22355
|
+
if (draggingDirection && mouseCurrentPos && tableRect) {
|
|
22356
|
+
if (isHeightChanging(draggingDirection)) {
|
|
22357
|
+
styles[draggingDirection].left = `${tableRect.left - parentRect.left}px`;
|
|
22358
|
+
styles[draggingDirection].top = `${(mouseCurrentPos.y - parentRect.top) / zoom}px`;
|
|
22359
|
+
styles[draggingDirection].height = "3px";
|
|
22360
|
+
styles[draggingDirection].width = `${tableRect.width}px`;
|
|
22361
|
+
} else {
|
|
22362
|
+
styles[draggingDirection].top = `${tableRect.top - parentRect.top}px`;
|
|
22363
|
+
styles[draggingDirection].left = `${(mouseCurrentPos.x - parentRect.left) / zoom}px`;
|
|
22364
|
+
styles[draggingDirection].width = "3px";
|
|
22365
|
+
styles[draggingDirection].height = `${tableRect.height}px`;
|
|
22366
|
+
}
|
|
22367
|
+
styles[draggingDirection].backgroundColor = "#adf";
|
|
22368
|
+
}
|
|
22369
|
+
return styles;
|
|
22370
|
+
}
|
|
22371
|
+
return {
|
|
22372
|
+
bottom: null,
|
|
22373
|
+
left: null,
|
|
22374
|
+
right: null,
|
|
22375
|
+
top: null
|
|
22376
|
+
};
|
|
22377
|
+
}, [activeCell, draggingDirection, mouseCurrentPos, positioningAnchorEl]);
|
|
22378
|
+
const resizerStyles = getResizers();
|
|
22379
|
+
return /* @__PURE__ */ jsx132("div", { ref: resizerRef, children: activeCell != null && !isMouseDown && /* @__PURE__ */ jsxs88(Fragment20, { children: [
|
|
22380
|
+
/* @__PURE__ */ jsx132(
|
|
22381
|
+
"div",
|
|
22382
|
+
{
|
|
22383
|
+
css: tableResizer,
|
|
22384
|
+
style: resizerStyles.right || void 0,
|
|
22385
|
+
onMouseDown: toggleResize("right")
|
|
22386
|
+
}
|
|
22387
|
+
),
|
|
22388
|
+
/* @__PURE__ */ jsx132(
|
|
22389
|
+
"div",
|
|
22390
|
+
{
|
|
22391
|
+
css: tableResizer,
|
|
22392
|
+
style: resizerStyles.bottom || void 0,
|
|
22393
|
+
onMouseDown: toggleResize("bottom")
|
|
22394
|
+
}
|
|
22395
|
+
)
|
|
22396
|
+
] }) });
|
|
22397
|
+
}
|
|
22398
|
+
function TableCellResizerPlugin({ positioningAnchorEl }) {
|
|
22399
|
+
const [editor] = useLexicalComposerContext6();
|
|
22400
|
+
const isEditable = useLexicalEditable2();
|
|
22401
|
+
return useMemo7(
|
|
22402
|
+
() => isEditable ? createPortal3(
|
|
22403
|
+
/* @__PURE__ */ jsx132(TableCellResizer, { editor, positioningAnchorEl }),
|
|
22404
|
+
positioningAnchorEl
|
|
22405
|
+
) : null,
|
|
22406
|
+
[editor, isEditable, positioningAnchorEl]
|
|
22407
|
+
);
|
|
22408
|
+
}
|
|
22409
|
+
|
|
21597
22410
|
// src/components/ParameterInputs/ParameterRichText.tsx
|
|
21598
|
-
import { Fragment as
|
|
22411
|
+
import { Fragment as Fragment21, jsx as jsx133, jsxs as jsxs89 } from "@emotion/react/jsx-runtime";
|
|
21599
22412
|
var ParameterRichText = ({
|
|
21600
22413
|
label,
|
|
21601
22414
|
labelLeadingIcon,
|
|
@@ -21614,13 +22427,16 @@ var ParameterRichText = ({
|
|
|
21614
22427
|
readOnly,
|
|
21615
22428
|
editorWrapperClassName,
|
|
21616
22429
|
editorInputClassName,
|
|
22430
|
+
editorInputWrapperClassName,
|
|
21617
22431
|
editorFooter,
|
|
21618
22432
|
customNodes,
|
|
21619
22433
|
children,
|
|
21620
22434
|
variables,
|
|
21621
|
-
customControls
|
|
22435
|
+
customControls,
|
|
22436
|
+
onInsertTable,
|
|
22437
|
+
minimalInteractivity
|
|
21622
22438
|
}) => {
|
|
21623
|
-
return /* @__PURE__ */
|
|
22439
|
+
return /* @__PURE__ */ jsxs89(
|
|
21624
22440
|
ParameterShell,
|
|
21625
22441
|
{
|
|
21626
22442
|
"data-testid": "parameter-richtext",
|
|
@@ -21634,7 +22450,7 @@ var ParameterRichText = ({
|
|
|
21634
22450
|
captionTestId,
|
|
21635
22451
|
menuItems,
|
|
21636
22452
|
children: [
|
|
21637
|
-
/* @__PURE__ */
|
|
22453
|
+
/* @__PURE__ */ jsx133(
|
|
21638
22454
|
ParameterRichTextInner,
|
|
21639
22455
|
{
|
|
21640
22456
|
value,
|
|
@@ -21645,30 +22461,33 @@ var ParameterRichText = ({
|
|
|
21645
22461
|
readOnly,
|
|
21646
22462
|
editorWrapperClassName,
|
|
21647
22463
|
editorInputClassName,
|
|
22464
|
+
editorInputWrapperClassName,
|
|
21648
22465
|
editorFooter,
|
|
21649
22466
|
customNodes,
|
|
21650
22467
|
variables,
|
|
21651
22468
|
customControls,
|
|
22469
|
+
onInsertTable,
|
|
22470
|
+
minimalInteractivity,
|
|
21652
22471
|
children
|
|
21653
22472
|
}
|
|
21654
22473
|
),
|
|
21655
|
-
menuItems ? /* @__PURE__ */
|
|
22474
|
+
menuItems ? /* @__PURE__ */ jsx133(ParameterMenuButton, { label: `${label} menu`, children: /* @__PURE__ */ jsx133(Fragment21, { children: menuItems }) }) : null
|
|
21656
22475
|
]
|
|
21657
22476
|
}
|
|
21658
22477
|
);
|
|
21659
22478
|
};
|
|
21660
|
-
var editorWrapper =
|
|
22479
|
+
var editorWrapper = css100`
|
|
21661
22480
|
display: flex;
|
|
21662
22481
|
flex-flow: column;
|
|
21663
22482
|
flex-grow: 1;
|
|
21664
22483
|
`;
|
|
21665
|
-
var editorContainer =
|
|
22484
|
+
var editorContainer = css100`
|
|
21666
22485
|
display: flex;
|
|
21667
22486
|
flex-flow: column;
|
|
21668
22487
|
flex-grow: 1;
|
|
21669
22488
|
position: relative;
|
|
21670
22489
|
`;
|
|
21671
|
-
var editorPlaceholder =
|
|
22490
|
+
var editorPlaceholder = css100`
|
|
21672
22491
|
color: var(--gray-500);
|
|
21673
22492
|
font-style: italic;
|
|
21674
22493
|
/* 1px is added to make sure caret is clearly visible when field is focused
|
|
@@ -21679,7 +22498,7 @@ var editorPlaceholder = css98`
|
|
|
21679
22498
|
top: var(--spacing-sm);
|
|
21680
22499
|
user-select: none;
|
|
21681
22500
|
`;
|
|
21682
|
-
var editorInput =
|
|
22501
|
+
var editorInput = css100`
|
|
21683
22502
|
background: var(--white);
|
|
21684
22503
|
border: 1px solid var(--gray-200);
|
|
21685
22504
|
border-radius: var(--rounded-sm);
|
|
@@ -21707,11 +22526,14 @@ var ParameterRichTextInner = ({
|
|
|
21707
22526
|
readOnly,
|
|
21708
22527
|
editorWrapperClassName,
|
|
21709
22528
|
editorInputClassName,
|
|
22529
|
+
editorInputWrapperClassName,
|
|
21710
22530
|
editorFooter,
|
|
21711
22531
|
children,
|
|
21712
22532
|
customNodes,
|
|
21713
22533
|
variables,
|
|
21714
|
-
customControls
|
|
22534
|
+
customControls,
|
|
22535
|
+
onInsertTable,
|
|
22536
|
+
minimalInteractivity
|
|
21715
22537
|
}) => {
|
|
21716
22538
|
const lexicalConfig = {
|
|
21717
22539
|
namespace: "uniform",
|
|
@@ -21727,6 +22549,9 @@ var ParameterRichTextInner = ({
|
|
|
21727
22549
|
QuoteNode,
|
|
21728
22550
|
ParagraphNode2,
|
|
21729
22551
|
CustomCodeNode,
|
|
22552
|
+
TableNode,
|
|
22553
|
+
TableCellNode2,
|
|
22554
|
+
TableRowNode2,
|
|
21730
22555
|
...customNodes != null ? customNodes : []
|
|
21731
22556
|
],
|
|
21732
22557
|
theme: {
|
|
@@ -21759,12 +22584,15 @@ var ParameterRichTextInner = ({
|
|
|
21759
22584
|
}
|
|
21760
22585
|
},
|
|
21761
22586
|
quote: blockquoteElement,
|
|
21762
|
-
code: codeElement
|
|
22587
|
+
code: codeElement,
|
|
22588
|
+
table: tableElement,
|
|
22589
|
+
tableCell: tableCellElement,
|
|
22590
|
+
tableCellHeader: tableHeaderElement
|
|
21763
22591
|
},
|
|
21764
22592
|
editable: !readOnly
|
|
21765
22593
|
};
|
|
21766
|
-
return /* @__PURE__ */
|
|
21767
|
-
/* @__PURE__ */
|
|
22594
|
+
return /* @__PURE__ */ jsxs89(Fragment21, { children: [
|
|
22595
|
+
/* @__PURE__ */ jsx133("div", { css: [editorWrapper], className: editorWrapperClassName, children: /* @__PURE__ */ jsx133(LexicalComposer, { initialConfig: lexicalConfig, children: /* @__PURE__ */ jsx133(
|
|
21768
22596
|
RichText,
|
|
21769
22597
|
{
|
|
21770
22598
|
onChange,
|
|
@@ -21773,8 +22601,11 @@ var ParameterRichTextInner = ({
|
|
|
21773
22601
|
onRichTextInit,
|
|
21774
22602
|
readOnly,
|
|
21775
22603
|
editorInputClassName,
|
|
22604
|
+
editorInputWrapperClassName,
|
|
21776
22605
|
variables,
|
|
21777
22606
|
customControls,
|
|
22607
|
+
onInsertTable,
|
|
22608
|
+
minimalInteractivity,
|
|
21778
22609
|
children
|
|
21779
22610
|
}
|
|
21780
22611
|
) }) }),
|
|
@@ -21797,18 +22628,20 @@ var RichText = ({
|
|
|
21797
22628
|
onRichTextInit,
|
|
21798
22629
|
readOnly,
|
|
21799
22630
|
editorInputClassName,
|
|
22631
|
+
editorInputWrapperClassName,
|
|
21800
22632
|
children,
|
|
21801
22633
|
variables,
|
|
21802
|
-
customControls
|
|
22634
|
+
customControls,
|
|
22635
|
+
onInsertTable,
|
|
22636
|
+
minimalInteractivity
|
|
21803
22637
|
}) => {
|
|
21804
|
-
const
|
|
21805
|
-
|
|
21806
|
-
useEffect21(() => {
|
|
22638
|
+
const [editor] = useLexicalComposerContext7();
|
|
22639
|
+
useEffect23(() => {
|
|
21807
22640
|
if (onRichTextInit) {
|
|
21808
22641
|
onRichTextInit(editor);
|
|
21809
22642
|
}
|
|
21810
22643
|
}, [editor, onRichTextInit]);
|
|
21811
|
-
|
|
22644
|
+
useEffect23(() => {
|
|
21812
22645
|
const removeUpdateListener = editor.registerUpdateListener(({ editorState, prevEditorState }) => {
|
|
21813
22646
|
requestAnimationFrame(() => {
|
|
21814
22647
|
if (!deepEqual2(editorState.toJSON(), prevEditorState.toJSON())) {
|
|
@@ -21820,53 +22653,72 @@ var RichText = ({
|
|
|
21820
22653
|
removeUpdateListener();
|
|
21821
22654
|
};
|
|
21822
22655
|
}, [editor, onChange]);
|
|
21823
|
-
|
|
22656
|
+
useEffect23(() => {
|
|
21824
22657
|
editor.setEditable(!readOnly);
|
|
21825
22658
|
}, [editor, readOnly]);
|
|
21826
|
-
|
|
21827
|
-
|
|
21828
|
-
|
|
21829
|
-
|
|
21830
|
-
|
|
21831
|
-
|
|
21832
|
-
|
|
21833
|
-
|
|
21834
|
-
|
|
21835
|
-
|
|
21836
|
-
|
|
21837
|
-
|
|
21838
|
-
|
|
21839
|
-
|
|
21840
|
-
|
|
21841
|
-
|
|
21842
|
-
|
|
21843
|
-
|
|
21844
|
-
|
|
21845
|
-
|
|
21846
|
-
|
|
21847
|
-
|
|
21848
|
-
|
|
21849
|
-
|
|
21850
|
-
|
|
21851
|
-
|
|
21852
|
-
|
|
21853
|
-
|
|
22659
|
+
const [editorContainerRef, setEditorContainerRef] = useState20(null);
|
|
22660
|
+
const onRef = (_editorContainerRef) => {
|
|
22661
|
+
if (_editorContainerRef !== null) {
|
|
22662
|
+
setEditorContainerRef(_editorContainerRef);
|
|
22663
|
+
}
|
|
22664
|
+
};
|
|
22665
|
+
return /* @__PURE__ */ jsxs89(Fragment21, { children: [
|
|
22666
|
+
readOnly || minimalInteractivity ? null : /* @__PURE__ */ jsx133(RichTextToolbar_default, { config, customControls, onInsertTable }),
|
|
22667
|
+
/* @__PURE__ */ jsxs89(
|
|
22668
|
+
"div",
|
|
22669
|
+
{
|
|
22670
|
+
css: editorContainer,
|
|
22671
|
+
className: editorInputWrapperClassName,
|
|
22672
|
+
ref: onRef,
|
|
22673
|
+
"data-testid": "value-container",
|
|
22674
|
+
children: [
|
|
22675
|
+
/* @__PURE__ */ jsx133(
|
|
22676
|
+
RichTextPlugin,
|
|
22677
|
+
{
|
|
22678
|
+
contentEditable: /* @__PURE__ */ jsx133(ContentEditable, { css: editorInput, className: editorInputClassName }),
|
|
22679
|
+
placeholder: /* @__PURE__ */ jsx133("div", { css: editorPlaceholder, children: readOnly ? "empty" : "start editing..." }),
|
|
22680
|
+
ErrorBoundary: LexicalErrorBoundary
|
|
22681
|
+
}
|
|
22682
|
+
),
|
|
22683
|
+
/* @__PURE__ */ jsx133(ListPlugin, {}),
|
|
22684
|
+
/* @__PURE__ */ jsx133(TablePlugin, {}),
|
|
22685
|
+
editorContainerRef && !minimalInteractivity ? /* @__PURE__ */ jsx133(TableActionMenuPlugin, { positioningAnchorEl: editorContainerRef }) : null,
|
|
22686
|
+
editorContainerRef && !minimalInteractivity ? /* @__PURE__ */ jsx133(TableCellResizerPlugin, { positioningAnchorEl: editorContainerRef }) : null,
|
|
22687
|
+
readOnly ? null : /* @__PURE__ */ jsx133(HistoryPlugin, {}),
|
|
22688
|
+
editorContainerRef ? /* @__PURE__ */ jsx133(
|
|
22689
|
+
LinkNodePlugin,
|
|
22690
|
+
{
|
|
22691
|
+
onConnectLink: onConnectLink ? onConnectLink : () => Promise.resolve(),
|
|
22692
|
+
getBoundPath: (variables == null ? void 0 : variables.bindVariables) ? (path) => {
|
|
22693
|
+
var _a, _b;
|
|
22694
|
+
return (_b = (_a = variables.bindVariables) == null ? void 0 : _a.call(variables, path)) != null ? _b : path;
|
|
22695
|
+
} : void 0,
|
|
22696
|
+
positioningAnchorEl: editorContainerRef
|
|
22697
|
+
}
|
|
22698
|
+
) : null,
|
|
22699
|
+
/* @__PURE__ */ jsx133(ListIndentPlugin, { maxDepth: 4 }),
|
|
22700
|
+
/* @__PURE__ */ jsx133(DisableStylesPlugin, {}),
|
|
22701
|
+
/* @__PURE__ */ jsx133(MarkdownShortcutPlugin, { transformers: MARKDOWN_TRANSFORMERS }),
|
|
22702
|
+
/* @__PURE__ */ jsx133(Fragment21, { children })
|
|
22703
|
+
]
|
|
22704
|
+
}
|
|
22705
|
+
)
|
|
21854
22706
|
] });
|
|
21855
22707
|
};
|
|
21856
22708
|
|
|
21857
22709
|
// src/components/ParameterInputs/ParameterSelect.tsx
|
|
21858
|
-
import { forwardRef as
|
|
21859
|
-
import { jsx as
|
|
21860
|
-
var ParameterSelect =
|
|
22710
|
+
import { forwardRef as forwardRef23 } from "react";
|
|
22711
|
+
import { jsx as jsx134, jsxs as jsxs90 } from "@emotion/react/jsx-runtime";
|
|
22712
|
+
var ParameterSelect = forwardRef23(
|
|
21861
22713
|
({ defaultOption, options, ...props }, ref) => {
|
|
21862
22714
|
const { shellProps, innerProps } = extractParameterProps(props);
|
|
21863
|
-
return /* @__PURE__ */
|
|
22715
|
+
return /* @__PURE__ */ jsx134(ParameterShell, { ...shellProps, children: /* @__PURE__ */ jsx134(ParameterSelectInner, { options, defaultOption, ...innerProps, ref }) });
|
|
21864
22716
|
}
|
|
21865
22717
|
);
|
|
21866
|
-
var ParameterSelectInner =
|
|
22718
|
+
var ParameterSelectInner = forwardRef23(
|
|
21867
22719
|
({ defaultOption, options, ...props }, ref) => {
|
|
21868
22720
|
const { id, label, hiddenLabel } = useParameterShell();
|
|
21869
|
-
return /* @__PURE__ */
|
|
22721
|
+
return /* @__PURE__ */ jsxs90(
|
|
21870
22722
|
"select",
|
|
21871
22723
|
{
|
|
21872
22724
|
css: [input3, selectInput],
|
|
@@ -21875,10 +22727,10 @@ var ParameterSelectInner = forwardRef22(
|
|
|
21875
22727
|
ref,
|
|
21876
22728
|
...props,
|
|
21877
22729
|
children: [
|
|
21878
|
-
defaultOption ? /* @__PURE__ */
|
|
22730
|
+
defaultOption ? /* @__PURE__ */ jsx134("option", { value: "", children: defaultOption }) : null,
|
|
21879
22731
|
options.map((option) => {
|
|
21880
22732
|
var _a;
|
|
21881
|
-
return /* @__PURE__ */
|
|
22733
|
+
return /* @__PURE__ */ jsx134("option", { value: (_a = option.value) != null ? _a : option.label, children: option.label }, option.label);
|
|
21882
22734
|
})
|
|
21883
22735
|
]
|
|
21884
22736
|
}
|
|
@@ -21887,15 +22739,15 @@ var ParameterSelectInner = forwardRef22(
|
|
|
21887
22739
|
);
|
|
21888
22740
|
|
|
21889
22741
|
// src/components/ParameterInputs/ParameterTextarea.tsx
|
|
21890
|
-
import { forwardRef as
|
|
21891
|
-
import { jsx as
|
|
21892
|
-
var ParameterTextarea =
|
|
22742
|
+
import { forwardRef as forwardRef24 } from "react";
|
|
22743
|
+
import { jsx as jsx135 } from "@emotion/react/jsx-runtime";
|
|
22744
|
+
var ParameterTextarea = forwardRef24((props, ref) => {
|
|
21893
22745
|
const { shellProps, innerProps } = extractParameterProps(props);
|
|
21894
|
-
return /* @__PURE__ */
|
|
22746
|
+
return /* @__PURE__ */ jsx135(ParameterShell, { "data-testid": "parameter-textarea", ...shellProps, children: /* @__PURE__ */ jsx135(ParameterTextareaInner, { ref, ...innerProps }) });
|
|
21895
22747
|
});
|
|
21896
|
-
var ParameterTextareaInner =
|
|
22748
|
+
var ParameterTextareaInner = forwardRef24(({ ...props }, ref) => {
|
|
21897
22749
|
const { id, label, hiddenLabel } = useParameterShell();
|
|
21898
|
-
return /* @__PURE__ */
|
|
22750
|
+
return /* @__PURE__ */ jsx135(
|
|
21899
22751
|
"textarea",
|
|
21900
22752
|
{
|
|
21901
22753
|
css: [input3, textarea2],
|
|
@@ -21908,26 +22760,26 @@ var ParameterTextareaInner = forwardRef23(({ ...props }, ref) => {
|
|
|
21908
22760
|
});
|
|
21909
22761
|
|
|
21910
22762
|
// src/components/ParameterInputs/ParameterToggle.tsx
|
|
21911
|
-
import { forwardRef as
|
|
21912
|
-
import { jsx as
|
|
21913
|
-
var ParameterToggle =
|
|
22763
|
+
import { forwardRef as forwardRef25 } from "react";
|
|
22764
|
+
import { jsx as jsx136, jsxs as jsxs91 } from "@emotion/react/jsx-runtime";
|
|
22765
|
+
var ParameterToggle = forwardRef25((props, ref) => {
|
|
21914
22766
|
const { shellProps, innerProps } = extractParameterProps(props);
|
|
21915
|
-
return /* @__PURE__ */
|
|
22767
|
+
return /* @__PURE__ */ jsx136(ParameterShell, { ...shellProps, children: /* @__PURE__ */ jsx136(ParameterToggleInner, { ref, ...innerProps }) });
|
|
21916
22768
|
});
|
|
21917
|
-
var ParameterToggleInner =
|
|
22769
|
+
var ParameterToggleInner = forwardRef25(
|
|
21918
22770
|
({ children, ...props }, ref) => {
|
|
21919
22771
|
const { id, label } = useParameterShell();
|
|
21920
|
-
return /* @__PURE__ */
|
|
21921
|
-
/* @__PURE__ */
|
|
21922
|
-
/* @__PURE__ */
|
|
22772
|
+
return /* @__PURE__ */ jsxs91("label", { css: inputToggleLabel2, children: [
|
|
22773
|
+
/* @__PURE__ */ jsx136("input", { css: toggleInput2, type: props.type, id, ref, ...props }),
|
|
22774
|
+
/* @__PURE__ */ jsx136("span", { css: inlineLabel2, children: label }),
|
|
21923
22775
|
children
|
|
21924
22776
|
] });
|
|
21925
22777
|
}
|
|
21926
22778
|
);
|
|
21927
22779
|
|
|
21928
22780
|
// src/components/ProgressBar/ProgressBar.styles.ts
|
|
21929
|
-
import { css as
|
|
21930
|
-
var container3 =
|
|
22781
|
+
import { css as css101, keyframes as keyframes4 } from "@emotion/react";
|
|
22782
|
+
var container3 = css101`
|
|
21931
22783
|
background: var(--gray-50);
|
|
21932
22784
|
margin-block: var(--spacing-sm);
|
|
21933
22785
|
position: relative;
|
|
@@ -21937,13 +22789,13 @@ var container3 = css99`
|
|
|
21937
22789
|
border: solid 1px var(--gray-300);
|
|
21938
22790
|
`;
|
|
21939
22791
|
var themeMap = {
|
|
21940
|
-
primary:
|
|
22792
|
+
primary: css101`
|
|
21941
22793
|
--progress-color: var(--accent-light);
|
|
21942
22794
|
`,
|
|
21943
|
-
secondary:
|
|
22795
|
+
secondary: css101`
|
|
21944
22796
|
--progress-color: var(--accent-alt-light);
|
|
21945
22797
|
`,
|
|
21946
|
-
destructive:
|
|
22798
|
+
destructive: css101`
|
|
21947
22799
|
--progress-color: var(--brand-secondary-5);
|
|
21948
22800
|
`
|
|
21949
22801
|
};
|
|
@@ -21955,10 +22807,10 @@ var slidingBackgroundPosition = keyframes4`
|
|
|
21955
22807
|
background-position: 64px 0;
|
|
21956
22808
|
}
|
|
21957
22809
|
`;
|
|
21958
|
-
var determinate =
|
|
22810
|
+
var determinate = css101`
|
|
21959
22811
|
background-color: var(--progress-color);
|
|
21960
22812
|
`;
|
|
21961
|
-
var indeterminate =
|
|
22813
|
+
var indeterminate = css101`
|
|
21962
22814
|
background-image: linear-gradient(
|
|
21963
22815
|
45deg,
|
|
21964
22816
|
var(--progress-color) 25%,
|
|
@@ -21972,7 +22824,7 @@ var indeterminate = css99`
|
|
|
21972
22824
|
background-size: 64px 64px;
|
|
21973
22825
|
animation: ${slidingBackgroundPosition} 1s linear infinite;
|
|
21974
22826
|
`;
|
|
21975
|
-
var bar =
|
|
22827
|
+
var bar = css101`
|
|
21976
22828
|
position: absolute;
|
|
21977
22829
|
inset: 0;
|
|
21978
22830
|
transition: transform var(--duration-fast) var(--timing-ease-out);
|
|
@@ -21980,7 +22832,7 @@ var bar = css99`
|
|
|
21980
22832
|
`;
|
|
21981
22833
|
|
|
21982
22834
|
// src/components/ProgressBar/ProgressBar.tsx
|
|
21983
|
-
import { jsx as
|
|
22835
|
+
import { jsx as jsx137 } from "@emotion/react/jsx-runtime";
|
|
21984
22836
|
function ProgressBar({
|
|
21985
22837
|
current,
|
|
21986
22838
|
max,
|
|
@@ -21990,7 +22842,7 @@ function ProgressBar({
|
|
|
21990
22842
|
}) {
|
|
21991
22843
|
const valueNow = Math.min(current, max);
|
|
21992
22844
|
const valuePercentage = max > 0 ? Math.ceil(100 / max * valueNow) : 0;
|
|
21993
|
-
return /* @__PURE__ */
|
|
22845
|
+
return /* @__PURE__ */ jsx137(
|
|
21994
22846
|
"div",
|
|
21995
22847
|
{
|
|
21996
22848
|
css: container3,
|
|
@@ -22001,7 +22853,7 @@ function ProgressBar({
|
|
|
22001
22853
|
"aria-valuemax": max,
|
|
22002
22854
|
"aria-valuenow": valueNow,
|
|
22003
22855
|
...props,
|
|
22004
|
-
children: /* @__PURE__ */
|
|
22856
|
+
children: /* @__PURE__ */ jsx137(
|
|
22005
22857
|
"div",
|
|
22006
22858
|
{
|
|
22007
22859
|
css: [
|
|
@@ -22020,30 +22872,30 @@ function ProgressBar({
|
|
|
22020
22872
|
}
|
|
22021
22873
|
|
|
22022
22874
|
// src/components/ProgressList/ProgressList.tsx
|
|
22023
|
-
import { css as
|
|
22875
|
+
import { css as css103 } from "@emotion/react";
|
|
22024
22876
|
import { CgCheckO as CgCheckO2 } from "@react-icons/all-files/cg/CgCheckO";
|
|
22025
22877
|
import { CgRadioCheck } from "@react-icons/all-files/cg/CgRadioCheck";
|
|
22026
22878
|
import { CgRecord } from "@react-icons/all-files/cg/CgRecord";
|
|
22027
|
-
import { useMemo as
|
|
22879
|
+
import { useMemo as useMemo8 } from "react";
|
|
22028
22880
|
|
|
22029
22881
|
// src/components/ProgressList/styles/ProgressList.styles.ts
|
|
22030
|
-
import { css as
|
|
22031
|
-
var progressListStyles =
|
|
22882
|
+
import { css as css102 } from "@emotion/react";
|
|
22883
|
+
var progressListStyles = css102`
|
|
22032
22884
|
display: flex;
|
|
22033
22885
|
flex-direction: column;
|
|
22034
22886
|
gap: var(--spacing-sm);
|
|
22035
22887
|
list-style-type: none;
|
|
22036
22888
|
`;
|
|
22037
|
-
var progressListItemStyles =
|
|
22889
|
+
var progressListItemStyles = css102`
|
|
22038
22890
|
display: flex;
|
|
22039
22891
|
gap: var(--spacing-base);
|
|
22040
22892
|
align-items: center;
|
|
22041
22893
|
`;
|
|
22042
22894
|
|
|
22043
22895
|
// src/components/ProgressList/ProgressList.tsx
|
|
22044
|
-
import { jsx as
|
|
22896
|
+
import { jsx as jsx138, jsxs as jsxs92 } from "@emotion/react/jsx-runtime";
|
|
22045
22897
|
var ProgressList = ({ inProgressId, items, autoEllipsis, ...htmlProps }) => {
|
|
22046
|
-
const itemsWithStatus =
|
|
22898
|
+
const itemsWithStatus = useMemo8(() => {
|
|
22047
22899
|
const indexOfInProgressItem = items.findIndex(({ id }) => id === inProgressId);
|
|
22048
22900
|
return items.map((item, index) => {
|
|
22049
22901
|
let status = "queued";
|
|
@@ -22055,8 +22907,8 @@ var ProgressList = ({ inProgressId, items, autoEllipsis, ...htmlProps }) => {
|
|
|
22055
22907
|
return { ...item, status };
|
|
22056
22908
|
});
|
|
22057
22909
|
}, [items, inProgressId]);
|
|
22058
|
-
return /* @__PURE__ */
|
|
22059
|
-
return /* @__PURE__ */
|
|
22910
|
+
return /* @__PURE__ */ jsx138("ol", { css: progressListStyles, ...htmlProps, children: itemsWithStatus.map(({ id, label, status, error, errorLevel }) => {
|
|
22911
|
+
return /* @__PURE__ */ jsx138(
|
|
22060
22912
|
ProgressListItem,
|
|
22061
22913
|
{
|
|
22062
22914
|
status,
|
|
@@ -22076,7 +22928,7 @@ var ProgressListItem = ({
|
|
|
22076
22928
|
errorLevel = "danger",
|
|
22077
22929
|
autoEllipsis = false
|
|
22078
22930
|
}) => {
|
|
22079
|
-
const icon =
|
|
22931
|
+
const icon = useMemo8(() => {
|
|
22080
22932
|
if (error) {
|
|
22081
22933
|
return warningIcon;
|
|
22082
22934
|
}
|
|
@@ -22087,14 +22939,14 @@ var ProgressListItem = ({
|
|
|
22087
22939
|
};
|
|
22088
22940
|
return iconPerStatus[status];
|
|
22089
22941
|
}, [status, error]);
|
|
22090
|
-
const statusStyles =
|
|
22942
|
+
const statusStyles = useMemo8(() => {
|
|
22091
22943
|
if (error) {
|
|
22092
|
-
return errorLevel === "caution" ?
|
|
22944
|
+
return errorLevel === "caution" ? css103`
|
|
22093
22945
|
color: rgb(161, 98, 7);
|
|
22094
22946
|
& svg {
|
|
22095
22947
|
color: rgb(250, 204, 21);
|
|
22096
22948
|
}
|
|
22097
|
-
` :
|
|
22949
|
+
` : css103`
|
|
22098
22950
|
color: rgb(185, 28, 28);
|
|
22099
22951
|
& svg {
|
|
22100
22952
|
color: var(--brand-primary-2);
|
|
@@ -22102,38 +22954,38 @@ var ProgressListItem = ({
|
|
|
22102
22954
|
`;
|
|
22103
22955
|
}
|
|
22104
22956
|
const colorPerStatus = {
|
|
22105
|
-
completed:
|
|
22957
|
+
completed: css103`
|
|
22106
22958
|
opacity: 0.75;
|
|
22107
22959
|
`,
|
|
22108
|
-
inProgress:
|
|
22960
|
+
inProgress: css103`
|
|
22109
22961
|
-webkit-text-stroke-width: thin;
|
|
22110
22962
|
`,
|
|
22111
|
-
queued:
|
|
22963
|
+
queued: css103`
|
|
22112
22964
|
opacity: 0.5;
|
|
22113
22965
|
`
|
|
22114
22966
|
};
|
|
22115
22967
|
return colorPerStatus[status];
|
|
22116
22968
|
}, [status, error, errorLevel]);
|
|
22117
|
-
return /* @__PURE__ */
|
|
22118
|
-
/* @__PURE__ */
|
|
22119
|
-
/* @__PURE__ */
|
|
22969
|
+
return /* @__PURE__ */ jsxs92("li", { css: [progressListItemStyles, statusStyles], children: [
|
|
22970
|
+
/* @__PURE__ */ jsx138(Tooltip, { title: error != null ? error : "", children: /* @__PURE__ */ jsx138("div", { children: /* @__PURE__ */ jsx138(Icon, { icon, size: 20, iconColor: "currentColor" }) }) }),
|
|
22971
|
+
/* @__PURE__ */ jsxs92("div", { children: [
|
|
22120
22972
|
children,
|
|
22121
|
-
/* @__PURE__ */
|
|
22973
|
+
/* @__PURE__ */ jsx138("span", { css: { visibility: autoEllipsis && status === "inProgress" && !error ? "visible" : "hidden" }, children: "..." })
|
|
22122
22974
|
] })
|
|
22123
22975
|
] });
|
|
22124
22976
|
};
|
|
22125
22977
|
|
|
22126
22978
|
// src/components/SegmentedControl/SegmentedControl.tsx
|
|
22127
|
-
import { css as
|
|
22979
|
+
import { css as css105 } from "@emotion/react";
|
|
22128
22980
|
import { CgCheck as CgCheck5 } from "@react-icons/all-files/cg/CgCheck";
|
|
22129
|
-
import { useCallback as
|
|
22981
|
+
import { useCallback as useCallback14, useEffect as useEffect24, useMemo as useMemo9, useRef as useRef13, useState as useState21 } from "react";
|
|
22130
22982
|
|
|
22131
22983
|
// src/components/SegmentedControl/SegmentedControl.styles.ts
|
|
22132
|
-
import { css as
|
|
22133
|
-
var segmentedControlRootStyles =
|
|
22984
|
+
import { css as css104 } from "@emotion/react";
|
|
22985
|
+
var segmentedControlRootStyles = css104`
|
|
22134
22986
|
position: relative;
|
|
22135
22987
|
`;
|
|
22136
|
-
var segmentedControlScrollIndicatorsStyles =
|
|
22988
|
+
var segmentedControlScrollIndicatorsStyles = css104`
|
|
22137
22989
|
position: absolute;
|
|
22138
22990
|
inset: 0;
|
|
22139
22991
|
z-index: 1;
|
|
@@ -22161,17 +23013,17 @@ var segmentedControlScrollIndicatorsStyles = css102`
|
|
|
22161
23013
|
background: linear-gradient(to left, var(--background-color) 10%, transparent);
|
|
22162
23014
|
}
|
|
22163
23015
|
`;
|
|
22164
|
-
var segmentedControlScrollIndicatorStartVisibleStyles =
|
|
23016
|
+
var segmentedControlScrollIndicatorStartVisibleStyles = css104`
|
|
22165
23017
|
&::before {
|
|
22166
23018
|
opacity: 1;
|
|
22167
23019
|
}
|
|
22168
23020
|
`;
|
|
22169
|
-
var segmentedControlScrollIndicatorEndVisibleStyles =
|
|
23021
|
+
var segmentedControlScrollIndicatorEndVisibleStyles = css104`
|
|
22170
23022
|
&::after {
|
|
22171
23023
|
opacity: 1;
|
|
22172
23024
|
}
|
|
22173
23025
|
`;
|
|
22174
|
-
var segmentedControlWrapperStyles =
|
|
23026
|
+
var segmentedControlWrapperStyles = css104`
|
|
22175
23027
|
overflow-y: auto;
|
|
22176
23028
|
scroll-behavior: smooth;
|
|
22177
23029
|
scrollbar-width: none;
|
|
@@ -22180,7 +23032,7 @@ var segmentedControlWrapperStyles = css102`
|
|
|
22180
23032
|
height: 0px;
|
|
22181
23033
|
}
|
|
22182
23034
|
`;
|
|
22183
|
-
var segmentedControlStyles =
|
|
23035
|
+
var segmentedControlStyles = css104`
|
|
22184
23036
|
--segmented-control-rounded-value: var(--rounded-base);
|
|
22185
23037
|
--segmented-control-border-width: 1px;
|
|
22186
23038
|
--segmented-control-selected-color: var(--brand-secondary-3);
|
|
@@ -22199,14 +23051,14 @@ var segmentedControlStyles = css102`
|
|
|
22199
23051
|
border-radius: calc(var(--segmented-control-rounded-value) + var(--segmented-control-border-width));
|
|
22200
23052
|
font-size: var(--fs-xs);
|
|
22201
23053
|
`;
|
|
22202
|
-
var segmentedControlVerticalStyles =
|
|
23054
|
+
var segmentedControlVerticalStyles = css104`
|
|
22203
23055
|
flex-direction: column;
|
|
22204
23056
|
--segmented-control-first-border-radius: var(--segmented-control-rounded-value)
|
|
22205
23057
|
var(--segmented-control-rounded-value) 0 0;
|
|
22206
23058
|
--segmented-control-last-border-radius: 0 0 var(--segmented-control-rounded-value)
|
|
22207
23059
|
var(--segmented-control-rounded-value);
|
|
22208
23060
|
`;
|
|
22209
|
-
var segmentedControlItemStyles =
|
|
23061
|
+
var segmentedControlItemStyles = css104`
|
|
22210
23062
|
&:first-of-type label {
|
|
22211
23063
|
border-radius: var(--segmented-control-first-border-radius);
|
|
22212
23064
|
}
|
|
@@ -22214,10 +23066,10 @@ var segmentedControlItemStyles = css102`
|
|
|
22214
23066
|
border-radius: var(--segmented-control-last-border-radius);
|
|
22215
23067
|
}
|
|
22216
23068
|
`;
|
|
22217
|
-
var segmentedControlInputStyles =
|
|
23069
|
+
var segmentedControlInputStyles = css104`
|
|
22218
23070
|
${accessibleHidden}
|
|
22219
23071
|
`;
|
|
22220
|
-
var segmentedControlLabelStyles = (checked, disabled2) =>
|
|
23072
|
+
var segmentedControlLabelStyles = (checked, disabled2) => css104`
|
|
22221
23073
|
position: relative;
|
|
22222
23074
|
display: flex;
|
|
22223
23075
|
align-items: center;
|
|
@@ -22284,25 +23136,25 @@ var segmentedControlLabelStyles = (checked, disabled2) => css102`
|
|
|
22284
23136
|
`}
|
|
22285
23137
|
}
|
|
22286
23138
|
`;
|
|
22287
|
-
var segmentedControlLabelIconOnlyStyles =
|
|
23139
|
+
var segmentedControlLabelIconOnlyStyles = css104`
|
|
22288
23140
|
padding-inline: 0.5em;
|
|
22289
23141
|
`;
|
|
22290
|
-
var segmentedControlLabelCheckStyles =
|
|
23142
|
+
var segmentedControlLabelCheckStyles = css104`
|
|
22291
23143
|
opacity: 0.5;
|
|
22292
23144
|
`;
|
|
22293
|
-
var segmentedControlLabelContentStyles =
|
|
23145
|
+
var segmentedControlLabelContentStyles = css104`
|
|
22294
23146
|
display: flex;
|
|
22295
23147
|
align-items: center;
|
|
22296
23148
|
justify-content: center;
|
|
22297
23149
|
gap: var(--spacing-sm);
|
|
22298
23150
|
height: 100%;
|
|
22299
23151
|
`;
|
|
22300
|
-
var segmentedControlLabelTextStyles =
|
|
23152
|
+
var segmentedControlLabelTextStyles = css104`
|
|
22301
23153
|
white-space: nowrap;
|
|
22302
23154
|
`;
|
|
22303
23155
|
|
|
22304
23156
|
// src/components/SegmentedControl/SegmentedControl.tsx
|
|
22305
|
-
import { jsx as
|
|
23157
|
+
import { jsx as jsx139, jsxs as jsxs93 } from "@emotion/react/jsx-runtime";
|
|
22306
23158
|
var SegmentedControl = ({
|
|
22307
23159
|
name,
|
|
22308
23160
|
options,
|
|
@@ -22318,9 +23170,9 @@ var SegmentedControl = ({
|
|
|
22318
23170
|
...props
|
|
22319
23171
|
}) => {
|
|
22320
23172
|
const wrapperRef = useRef13(null);
|
|
22321
|
-
const [isOverflowStartShadowVisible, setIsOverflowStartShadowVisible] =
|
|
22322
|
-
const [isOverflowEndShadowVisible, setIsOverflowEndShadowVisible] =
|
|
22323
|
-
const onOptionChange =
|
|
23173
|
+
const [isOverflowStartShadowVisible, setIsOverflowStartShadowVisible] = useState21(false);
|
|
23174
|
+
const [isOverflowEndShadowVisible, setIsOverflowEndShadowVisible] = useState21(false);
|
|
23175
|
+
const onOptionChange = useCallback14(
|
|
22324
23176
|
(event) => {
|
|
22325
23177
|
if (event.target.checked) {
|
|
22326
23178
|
onChange == null ? void 0 : onChange(options[parseInt(event.target.value)].value);
|
|
@@ -22328,19 +23180,19 @@ var SegmentedControl = ({
|
|
|
22328
23180
|
},
|
|
22329
23181
|
[options, onChange]
|
|
22330
23182
|
);
|
|
22331
|
-
const sizeStyles =
|
|
23183
|
+
const sizeStyles = useMemo9(() => {
|
|
22332
23184
|
const map = {
|
|
22333
|
-
sm:
|
|
22334
|
-
md:
|
|
22335
|
-
lg:
|
|
22336
|
-
xl:
|
|
23185
|
+
sm: css105({ height: "calc(24px - 2px)", fontSize: "var(--fs-xs)" }),
|
|
23186
|
+
md: css105({ height: "calc(32px - 2px)", fontSize: "var(--fs-sm)" }),
|
|
23187
|
+
lg: css105({ height: "calc(40px - 2px)", fontSize: "var(--fs-base)" }),
|
|
23188
|
+
xl: css105({ height: "calc(48px - 2px)", fontSize: "var(--fs-base)" })
|
|
22337
23189
|
};
|
|
22338
23190
|
return map[size];
|
|
22339
23191
|
}, [size]);
|
|
22340
|
-
const isIconOnly =
|
|
23192
|
+
const isIconOnly = useMemo9(() => {
|
|
22341
23193
|
return options.every((option) => option && option.icon && !option.label);
|
|
22342
23194
|
}, [options]);
|
|
22343
|
-
|
|
23195
|
+
useEffect24(() => {
|
|
22344
23196
|
const wrapperElement = wrapperRef.current;
|
|
22345
23197
|
const onScroll = () => {
|
|
22346
23198
|
if (!wrapperElement) {
|
|
@@ -22361,8 +23213,8 @@ var SegmentedControl = ({
|
|
|
22361
23213
|
wrapperElement == null ? void 0 : wrapperElement.removeEventListener("scroll", onScroll);
|
|
22362
23214
|
};
|
|
22363
23215
|
}, []);
|
|
22364
|
-
return /* @__PURE__ */
|
|
22365
|
-
/* @__PURE__ */
|
|
23216
|
+
return /* @__PURE__ */ jsxs93("div", { css: [segmentedControlRootStyles, { "--background-color": currentBackgroundColor }], children: [
|
|
23217
|
+
/* @__PURE__ */ jsx139("div", { ref: wrapperRef, css: segmentedControlWrapperStyles, children: /* @__PURE__ */ jsx139(
|
|
22366
23218
|
"div",
|
|
22367
23219
|
{
|
|
22368
23220
|
css: [
|
|
@@ -22378,12 +23230,12 @@ var SegmentedControl = ({
|
|
|
22378
23230
|
}
|
|
22379
23231
|
const text = option.label ? option.label : option.icon ? null : String(option.value);
|
|
22380
23232
|
const isDisabled = disabled2 || option.disabled;
|
|
22381
|
-
return /* @__PURE__ */
|
|
23233
|
+
return /* @__PURE__ */ jsx139(Tooltip, { title: (_a = option.tooltip) != null ? _a : "", children: /* @__PURE__ */ jsx139(
|
|
22382
23234
|
"div",
|
|
22383
23235
|
{
|
|
22384
23236
|
css: segmentedControlItemStyles,
|
|
22385
23237
|
"data-testid": option["data-testid"] ? option["data-testid"] : "container-segmented-control",
|
|
22386
|
-
children: /* @__PURE__ */
|
|
23238
|
+
children: /* @__PURE__ */ jsxs93(
|
|
22387
23239
|
"label",
|
|
22388
23240
|
{
|
|
22389
23241
|
css: [
|
|
@@ -22392,7 +23244,7 @@ var SegmentedControl = ({
|
|
|
22392
23244
|
isIconOnly ? segmentedControlLabelIconOnlyStyles : void 0
|
|
22393
23245
|
],
|
|
22394
23246
|
children: [
|
|
22395
|
-
/* @__PURE__ */
|
|
23247
|
+
/* @__PURE__ */ jsx139(
|
|
22396
23248
|
"input",
|
|
22397
23249
|
{
|
|
22398
23250
|
css: segmentedControlInputStyles,
|
|
@@ -22404,10 +23256,10 @@ var SegmentedControl = ({
|
|
|
22404
23256
|
disabled: isDisabled
|
|
22405
23257
|
}
|
|
22406
23258
|
),
|
|
22407
|
-
option.value !== value || noCheckmark ? null : /* @__PURE__ */
|
|
22408
|
-
/* @__PURE__ */
|
|
22409
|
-
!option.icon ? null : /* @__PURE__ */
|
|
22410
|
-
!text || hideOptionText ? null : /* @__PURE__ */
|
|
23259
|
+
option.value !== value || noCheckmark ? null : /* @__PURE__ */ jsx139(CgCheck5, { css: segmentedControlLabelCheckStyles, "aria-label": "Selected", size: "1.5em" }),
|
|
23260
|
+
/* @__PURE__ */ jsxs93("span", { css: segmentedControlLabelContentStyles, children: [
|
|
23261
|
+
!option.icon ? null : /* @__PURE__ */ jsx139(Icon, { icon: option.icon, size: iconSize, iconColor: "currentColor" }),
|
|
23262
|
+
!text || hideOptionText ? null : /* @__PURE__ */ jsx139("span", { css: segmentedControlLabelTextStyles, children: text })
|
|
22411
23263
|
] })
|
|
22412
23264
|
]
|
|
22413
23265
|
}
|
|
@@ -22417,7 +23269,7 @@ var SegmentedControl = ({
|
|
|
22417
23269
|
})
|
|
22418
23270
|
}
|
|
22419
23271
|
) }),
|
|
22420
|
-
/* @__PURE__ */
|
|
23272
|
+
/* @__PURE__ */ jsx139(
|
|
22421
23273
|
"div",
|
|
22422
23274
|
{
|
|
22423
23275
|
css: [
|
|
@@ -22431,18 +23283,18 @@ var SegmentedControl = ({
|
|
|
22431
23283
|
};
|
|
22432
23284
|
|
|
22433
23285
|
// src/components/Skeleton/Skeleton.styles.ts
|
|
22434
|
-
import { css as
|
|
23286
|
+
import { css as css106, keyframes as keyframes5 } from "@emotion/react";
|
|
22435
23287
|
var lightFadingOut = keyframes5`
|
|
22436
23288
|
from { opacity: 0.1; }
|
|
22437
23289
|
to { opacity: 0.025; }
|
|
22438
23290
|
`;
|
|
22439
|
-
var skeletonStyles =
|
|
23291
|
+
var skeletonStyles = css106`
|
|
22440
23292
|
animation: ${lightFadingOut} 1s ease-out infinite alternate;
|
|
22441
23293
|
background-color: var(--gray-900);
|
|
22442
23294
|
`;
|
|
22443
23295
|
|
|
22444
23296
|
// src/components/Skeleton/Skeleton.tsx
|
|
22445
|
-
import { jsx as
|
|
23297
|
+
import { jsx as jsx140 } from "@emotion/react/jsx-runtime";
|
|
22446
23298
|
var Skeleton = ({
|
|
22447
23299
|
width = "100%",
|
|
22448
23300
|
height = "1.25rem",
|
|
@@ -22450,7 +23302,7 @@ var Skeleton = ({
|
|
|
22450
23302
|
circle = false,
|
|
22451
23303
|
children,
|
|
22452
23304
|
...otherProps
|
|
22453
|
-
}) => /* @__PURE__ */
|
|
23305
|
+
}) => /* @__PURE__ */ jsx140(
|
|
22454
23306
|
"div",
|
|
22455
23307
|
{
|
|
22456
23308
|
css: [
|
|
@@ -22470,11 +23322,11 @@ var Skeleton = ({
|
|
|
22470
23322
|
);
|
|
22471
23323
|
|
|
22472
23324
|
// src/components/Switch/Switch.tsx
|
|
22473
|
-
import { forwardRef as
|
|
23325
|
+
import { forwardRef as forwardRef26 } from "react";
|
|
22474
23326
|
|
|
22475
23327
|
// src/components/Switch/Switch.styles.ts
|
|
22476
|
-
import { css as
|
|
22477
|
-
var SwitchInputContainer =
|
|
23328
|
+
import { css as css107 } from "@emotion/react";
|
|
23329
|
+
var SwitchInputContainer = css107`
|
|
22478
23330
|
cursor: pointer;
|
|
22479
23331
|
display: inline-block;
|
|
22480
23332
|
position: relative;
|
|
@@ -22483,7 +23335,7 @@ var SwitchInputContainer = css105`
|
|
|
22483
23335
|
vertical-align: middle;
|
|
22484
23336
|
user-select: none;
|
|
22485
23337
|
`;
|
|
22486
|
-
var SwitchInput = (size) =>
|
|
23338
|
+
var SwitchInput = (size) => css107`
|
|
22487
23339
|
appearance: none;
|
|
22488
23340
|
border-radius: var(--rounded-full);
|
|
22489
23341
|
background-color: var(--white);
|
|
@@ -22522,7 +23374,7 @@ var SwitchInput = (size) => css105`
|
|
|
22522
23374
|
cursor: not-allowed;
|
|
22523
23375
|
}
|
|
22524
23376
|
`;
|
|
22525
|
-
var SwitchInputDisabled =
|
|
23377
|
+
var SwitchInputDisabled = css107`
|
|
22526
23378
|
opacity: var(--opacity-50);
|
|
22527
23379
|
cursor: not-allowed;
|
|
22528
23380
|
|
|
@@ -22530,7 +23382,7 @@ var SwitchInputDisabled = css105`
|
|
|
22530
23382
|
cursor: not-allowed;
|
|
22531
23383
|
}
|
|
22532
23384
|
`;
|
|
22533
|
-
var SwitchInputLabel = (size) =>
|
|
23385
|
+
var SwitchInputLabel = (size) => css107`
|
|
22534
23386
|
align-items: center;
|
|
22535
23387
|
color: var(--typography-base);
|
|
22536
23388
|
display: inline-flex;
|
|
@@ -22552,32 +23404,32 @@ var SwitchInputLabel = (size) => css105`
|
|
|
22552
23404
|
top: 0;
|
|
22553
23405
|
}
|
|
22554
23406
|
`;
|
|
22555
|
-
var SwitchText = (size) =>
|
|
23407
|
+
var SwitchText = (size) => css107`
|
|
22556
23408
|
color: var(--gray-500);
|
|
22557
23409
|
font-size: var(--fs-sm);
|
|
22558
23410
|
padding-inline: ${size === "sm" ? "var(--spacing-xl)" : "var(--spacing-2xl)"} 0;
|
|
22559
23411
|
`;
|
|
22560
23412
|
|
|
22561
23413
|
// src/components/Switch/Switch.tsx
|
|
22562
|
-
import { Fragment as
|
|
22563
|
-
var Switch =
|
|
23414
|
+
import { Fragment as Fragment22, jsx as jsx141, jsxs as jsxs94 } from "@emotion/react/jsx-runtime";
|
|
23415
|
+
var Switch = forwardRef26(
|
|
22564
23416
|
({ label, infoText, toggleText, children, switchSize = "base", ...inputProps }, ref) => {
|
|
22565
23417
|
let additionalText = infoText;
|
|
22566
23418
|
if (infoText && toggleText) {
|
|
22567
23419
|
additionalText = inputProps.checked ? toggleText : infoText;
|
|
22568
23420
|
}
|
|
22569
|
-
return /* @__PURE__ */
|
|
22570
|
-
/* @__PURE__ */
|
|
23421
|
+
return /* @__PURE__ */ jsxs94(Fragment22, { children: [
|
|
23422
|
+
/* @__PURE__ */ jsxs94(
|
|
22571
23423
|
"label",
|
|
22572
23424
|
{
|
|
22573
23425
|
css: [SwitchInputContainer, inputProps.disabled ? SwitchInputDisabled : void 0],
|
|
22574
23426
|
children: [
|
|
22575
|
-
/* @__PURE__ */
|
|
22576
|
-
/* @__PURE__ */
|
|
23427
|
+
/* @__PURE__ */ jsx141("input", { type: "checkbox", css: SwitchInput(switchSize), ...inputProps, ref }),
|
|
23428
|
+
/* @__PURE__ */ jsx141("span", { css: SwitchInputLabel(switchSize), children: label })
|
|
22577
23429
|
]
|
|
22578
23430
|
}
|
|
22579
23431
|
),
|
|
22580
|
-
additionalText ? /* @__PURE__ */
|
|
23432
|
+
additionalText ? /* @__PURE__ */ jsx141("p", { css: SwitchText(switchSize), children: additionalText }) : null,
|
|
22581
23433
|
children
|
|
22582
23434
|
] });
|
|
22583
23435
|
}
|
|
@@ -22587,8 +23439,8 @@ var Switch = forwardRef25(
|
|
|
22587
23439
|
import * as React24 from "react";
|
|
22588
23440
|
|
|
22589
23441
|
// src/components/Table/Table.styles.ts
|
|
22590
|
-
import { css as
|
|
22591
|
-
var table = ({ cellPadding = "var(--spacing-sm) var(--spacing-md)" }) =>
|
|
23442
|
+
import { css as css108 } from "@emotion/react";
|
|
23443
|
+
var table = ({ cellPadding = "var(--spacing-sm) var(--spacing-md)" }) => css108`
|
|
22592
23444
|
border-bottom: 1px solid var(--gray-400);
|
|
22593
23445
|
border-collapse: collapse;
|
|
22594
23446
|
min-width: 100%;
|
|
@@ -22608,54 +23460,54 @@ var table = ({ cellPadding = "var(--spacing-sm) var(--spacing-md)" }) => css106`
|
|
|
22608
23460
|
background-color: var(--gray-50);
|
|
22609
23461
|
}
|
|
22610
23462
|
`;
|
|
22611
|
-
var tableHead =
|
|
23463
|
+
var tableHead = css108`
|
|
22612
23464
|
color: var(--typography-base);
|
|
22613
23465
|
text-align: left;
|
|
22614
23466
|
`;
|
|
22615
|
-
var tableRow =
|
|
23467
|
+
var tableRow = css108`
|
|
22616
23468
|
border-bottom: 1px solid var(--gray-100);
|
|
22617
23469
|
`;
|
|
22618
|
-
var tableCellHead =
|
|
23470
|
+
var tableCellHead = css108`
|
|
22619
23471
|
font-size: var(--fs-sm);
|
|
22620
23472
|
text-transform: uppercase;
|
|
22621
23473
|
font-weight: var(--fw-bold);
|
|
22622
23474
|
`;
|
|
22623
23475
|
|
|
22624
23476
|
// src/components/Table/Table.tsx
|
|
22625
|
-
import { jsx as
|
|
23477
|
+
import { jsx as jsx142 } from "@emotion/react/jsx-runtime";
|
|
22626
23478
|
var Table = React24.forwardRef(
|
|
22627
23479
|
({ children, cellPadding, ...otherProps }, ref) => {
|
|
22628
|
-
return /* @__PURE__ */
|
|
23480
|
+
return /* @__PURE__ */ jsx142("table", { ref, css: table({ cellPadding }), ...otherProps, children });
|
|
22629
23481
|
}
|
|
22630
23482
|
);
|
|
22631
23483
|
var TableHead = React24.forwardRef(
|
|
22632
23484
|
({ children, ...otherProps }, ref) => {
|
|
22633
|
-
return /* @__PURE__ */
|
|
23485
|
+
return /* @__PURE__ */ jsx142("thead", { ref, css: tableHead, ...otherProps, children });
|
|
22634
23486
|
}
|
|
22635
23487
|
);
|
|
22636
23488
|
var TableBody = React24.forwardRef(
|
|
22637
23489
|
({ children, ...otherProps }, ref) => {
|
|
22638
|
-
return /* @__PURE__ */
|
|
23490
|
+
return /* @__PURE__ */ jsx142("tbody", { ref, ...otherProps, children });
|
|
22639
23491
|
}
|
|
22640
23492
|
);
|
|
22641
23493
|
var TableFoot = React24.forwardRef(
|
|
22642
23494
|
({ children, ...otherProps }, ref) => {
|
|
22643
|
-
return /* @__PURE__ */
|
|
23495
|
+
return /* @__PURE__ */ jsx142("tfoot", { ref, ...otherProps, children });
|
|
22644
23496
|
}
|
|
22645
23497
|
);
|
|
22646
23498
|
var TableRow = React24.forwardRef(
|
|
22647
23499
|
({ children, ...otherProps }, ref) => {
|
|
22648
|
-
return /* @__PURE__ */
|
|
23500
|
+
return /* @__PURE__ */ jsx142("tr", { ref, css: tableRow, ...otherProps, children });
|
|
22649
23501
|
}
|
|
22650
23502
|
);
|
|
22651
23503
|
var TableCellHead = React24.forwardRef(
|
|
22652
23504
|
({ children, ...otherProps }, ref) => {
|
|
22653
|
-
return /* @__PURE__ */
|
|
23505
|
+
return /* @__PURE__ */ jsx142("th", { ref, css: tableCellHead, ...otherProps, children });
|
|
22654
23506
|
}
|
|
22655
23507
|
);
|
|
22656
23508
|
var TableCellData = React24.forwardRef(
|
|
22657
23509
|
({ children, ...otherProps }, ref) => {
|
|
22658
|
-
return /* @__PURE__ */
|
|
23510
|
+
return /* @__PURE__ */ jsx142("td", { ref, ...otherProps, children });
|
|
22659
23511
|
}
|
|
22660
23512
|
);
|
|
22661
23513
|
|
|
@@ -22667,11 +23519,11 @@ import {
|
|
|
22667
23519
|
TabProvider as AriakitTabProvider,
|
|
22668
23520
|
useTabStore as useAriakitTabStore
|
|
22669
23521
|
} from "@ariakit/react";
|
|
22670
|
-
import { useCallback as
|
|
23522
|
+
import { useCallback as useCallback15, useEffect as useEffect25, useMemo as useMemo10 } from "react";
|
|
22671
23523
|
|
|
22672
23524
|
// src/components/Tabs/Tabs.styles.ts
|
|
22673
|
-
import { css as
|
|
22674
|
-
var tabButtonStyles =
|
|
23525
|
+
import { css as css109 } from "@emotion/react";
|
|
23526
|
+
var tabButtonStyles = css109`
|
|
22675
23527
|
align-items: center;
|
|
22676
23528
|
border: 0;
|
|
22677
23529
|
height: 2.5rem;
|
|
@@ -22688,14 +23540,14 @@ var tabButtonStyles = css107`
|
|
|
22688
23540
|
box-shadow: inset 0 -2px 0 var(--brand-secondary-3);
|
|
22689
23541
|
}
|
|
22690
23542
|
`;
|
|
22691
|
-
var tabButtonGroupStyles =
|
|
23543
|
+
var tabButtonGroupStyles = css109`
|
|
22692
23544
|
display: flex;
|
|
22693
23545
|
gap: var(--spacing-base);
|
|
22694
23546
|
border-bottom: 1px solid var(--gray-300);
|
|
22695
23547
|
`;
|
|
22696
23548
|
|
|
22697
23549
|
// src/components/Tabs/Tabs.tsx
|
|
22698
|
-
import { jsx as
|
|
23550
|
+
import { jsx as jsx143 } from "@emotion/react/jsx-runtime";
|
|
22699
23551
|
var useCurrentTab = () => {
|
|
22700
23552
|
const context = useAriakitTabStore();
|
|
22701
23553
|
if (!context) {
|
|
@@ -22711,12 +23563,12 @@ var Tabs = ({
|
|
|
22711
23563
|
manual,
|
|
22712
23564
|
...props
|
|
22713
23565
|
}) => {
|
|
22714
|
-
const selected =
|
|
23566
|
+
const selected = useMemo10(() => {
|
|
22715
23567
|
if (selectedId) return selectedId;
|
|
22716
23568
|
return useHashForState && typeof window !== "undefined" && window.location.hash ? window.location.hash.substring(1) : void 0;
|
|
22717
23569
|
}, [selectedId, useHashForState]);
|
|
22718
23570
|
const tab = useAriakitTabStore({ ...props, selectOnMove: !manual, selectedId: selected });
|
|
22719
|
-
const onTabSelect =
|
|
23571
|
+
const onTabSelect = useCallback15(
|
|
22720
23572
|
(value) => {
|
|
22721
23573
|
const selectedValueWithoutNull = value != null ? value : void 0;
|
|
22722
23574
|
onSelectedIdChange == null ? void 0 : onSelectedIdChange(selectedValueWithoutNull);
|
|
@@ -22727,33 +23579,33 @@ var Tabs = ({
|
|
|
22727
23579
|
},
|
|
22728
23580
|
[onSelectedIdChange, useHashForState]
|
|
22729
23581
|
);
|
|
22730
|
-
|
|
23582
|
+
useEffect25(() => {
|
|
22731
23583
|
if (selected && selected !== tab.getState().activeId) {
|
|
22732
23584
|
tab.setSelectedId(selected);
|
|
22733
23585
|
}
|
|
22734
23586
|
}, [selected, tab]);
|
|
22735
|
-
return /* @__PURE__ */
|
|
23587
|
+
return /* @__PURE__ */ jsx143(AriakitTabProvider, { store: tab, setSelectedId: onTabSelect, children });
|
|
22736
23588
|
};
|
|
22737
23589
|
var TabButtonGroup = ({ children, ...props }) => {
|
|
22738
|
-
return /* @__PURE__ */
|
|
23590
|
+
return /* @__PURE__ */ jsx143(AriakitTabList, { ...props, css: tabButtonGroupStyles, children });
|
|
22739
23591
|
};
|
|
22740
23592
|
var TabButton = ({
|
|
22741
23593
|
children,
|
|
22742
23594
|
id,
|
|
22743
23595
|
...props
|
|
22744
23596
|
}) => {
|
|
22745
|
-
return /* @__PURE__ */
|
|
23597
|
+
return /* @__PURE__ */ jsx143(AriakitTab, { type: "button", id, ...props, css: tabButtonStyles, children });
|
|
22746
23598
|
};
|
|
22747
23599
|
var TabContent = ({
|
|
22748
23600
|
children,
|
|
22749
23601
|
...props
|
|
22750
23602
|
}) => {
|
|
22751
|
-
return /* @__PURE__ */
|
|
23603
|
+
return /* @__PURE__ */ jsx143(AriakitTabPanel, { ...props, children });
|
|
22752
23604
|
};
|
|
22753
23605
|
|
|
22754
23606
|
// src/components/Validation/StatusBullet.styles.ts
|
|
22755
|
-
import { css as
|
|
22756
|
-
var StatusBulletContainer =
|
|
23607
|
+
import { css as css110 } from "@emotion/react";
|
|
23608
|
+
var StatusBulletContainer = css110`
|
|
22757
23609
|
align-items: center;
|
|
22758
23610
|
align-self: center;
|
|
22759
23611
|
color: var(--gray-500);
|
|
@@ -22770,33 +23622,33 @@ var StatusBulletContainer = css108`
|
|
|
22770
23622
|
display: block;
|
|
22771
23623
|
}
|
|
22772
23624
|
`;
|
|
22773
|
-
var StatusBulletBase =
|
|
23625
|
+
var StatusBulletBase = css110`
|
|
22774
23626
|
font-size: var(--fs-sm);
|
|
22775
23627
|
&:before {
|
|
22776
23628
|
width: var(--fs-xs);
|
|
22777
23629
|
height: var(--fs-xs);
|
|
22778
23630
|
}
|
|
22779
23631
|
`;
|
|
22780
|
-
var StatusBulletSmall =
|
|
23632
|
+
var StatusBulletSmall = css110`
|
|
22781
23633
|
font-size: var(--fs-xs);
|
|
22782
23634
|
&:before {
|
|
22783
23635
|
width: var(--fs-xxs);
|
|
22784
23636
|
height: var(--fs-xxs);
|
|
22785
23637
|
}
|
|
22786
23638
|
`;
|
|
22787
|
-
var StatusDraft =
|
|
23639
|
+
var StatusDraft = css110`
|
|
22788
23640
|
&:before {
|
|
22789
23641
|
background: var(--white);
|
|
22790
23642
|
box-shadow: inset 0 0 0 0.125rem var(--accent-dark);
|
|
22791
23643
|
}
|
|
22792
23644
|
`;
|
|
22793
|
-
var StatusModified =
|
|
23645
|
+
var StatusModified = css110`
|
|
22794
23646
|
&:before {
|
|
22795
23647
|
background: linear-gradient(to right, var(--white) 50%, var(--accent-dark) 50% 100%);
|
|
22796
23648
|
box-shadow: inset 0 0 0 0.125rem var(--accent-dark);
|
|
22797
23649
|
}
|
|
22798
23650
|
`;
|
|
22799
|
-
var StatusError =
|
|
23651
|
+
var StatusError = css110`
|
|
22800
23652
|
color: var(--error);
|
|
22801
23653
|
&:before {
|
|
22802
23654
|
/* TODO: replace this with an svg icon */
|
|
@@ -22809,29 +23661,29 @@ var StatusError = css108`
|
|
|
22809
23661
|
);
|
|
22810
23662
|
}
|
|
22811
23663
|
`;
|
|
22812
|
-
var StatusPublished =
|
|
23664
|
+
var StatusPublished = css110`
|
|
22813
23665
|
&:before {
|
|
22814
23666
|
background: var(--accent-dark);
|
|
22815
23667
|
}
|
|
22816
23668
|
`;
|
|
22817
|
-
var StatusOrphan =
|
|
23669
|
+
var StatusOrphan = css110`
|
|
22818
23670
|
&:before {
|
|
22819
23671
|
background: var(--brand-secondary-5);
|
|
22820
23672
|
}
|
|
22821
23673
|
`;
|
|
22822
|
-
var StatusUnknown =
|
|
23674
|
+
var StatusUnknown = css110`
|
|
22823
23675
|
&:before {
|
|
22824
23676
|
background: var(--gray-800);
|
|
22825
23677
|
}
|
|
22826
23678
|
`;
|
|
22827
|
-
var StatusDeleted =
|
|
23679
|
+
var StatusDeleted = css110`
|
|
22828
23680
|
&:before {
|
|
22829
23681
|
background: var(--error);
|
|
22830
23682
|
}
|
|
22831
23683
|
`;
|
|
22832
23684
|
|
|
22833
23685
|
// src/components/Validation/StatusBullet.tsx
|
|
22834
|
-
import { jsx as
|
|
23686
|
+
import { jsx as jsx144 } from "@emotion/react/jsx-runtime";
|
|
22835
23687
|
var StatusBullet = ({
|
|
22836
23688
|
status,
|
|
22837
23689
|
hideText = false,
|
|
@@ -22851,7 +23703,7 @@ var StatusBullet = ({
|
|
|
22851
23703
|
Deleted: StatusDeleted
|
|
22852
23704
|
};
|
|
22853
23705
|
const statusSize = size === "base" ? StatusBulletBase : StatusBulletSmall;
|
|
22854
|
-
return /* @__PURE__ */
|
|
23706
|
+
return /* @__PURE__ */ jsx144(
|
|
22855
23707
|
"span",
|
|
22856
23708
|
{
|
|
22857
23709
|
role: "status",
|