@crystallize/design-system 1.16.5 → 1.16.6
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/CHANGELOG.md +6 -0
- package/dist/index.css +43 -42
- package/dist/index.d.ts +1 -1
- package/dist/index.js +324 -322
- package/dist/index.mjs +324 -322
- package/package.json +1 -1
- package/src/input-with-label/input-with-label.tsx +4 -3
- package/src/tooltip/tooltip.css +1 -1
- package/src/tooltip/tooltip.tsx +2 -2
package/dist/index.mjs
CHANGED
|
@@ -5326,8 +5326,47 @@ var Label2 = forwardRef92(({ className, ...delegated }, ref) => {
|
|
|
5326
5326
|
});
|
|
5327
5327
|
Label2.displayName = "Label";
|
|
5328
5328
|
|
|
5329
|
+
// src/tooltip/tooltip.tsx
|
|
5330
|
+
import * as RadixTooltip from "@radix-ui/react-tooltip";
|
|
5331
|
+
import { jsx as jsx104, jsxs as jsxs89 } from "react/jsx-runtime";
|
|
5332
|
+
function Tooltip({
|
|
5333
|
+
children,
|
|
5334
|
+
content,
|
|
5335
|
+
side = "top",
|
|
5336
|
+
align = "center",
|
|
5337
|
+
defaultOpen = false,
|
|
5338
|
+
delayDuration = 800
|
|
5339
|
+
}) {
|
|
5340
|
+
return /* @__PURE__ */ jsx104(RadixTooltip.Provider, {
|
|
5341
|
+
delayDuration,
|
|
5342
|
+
children: /* @__PURE__ */ jsxs89(RadixTooltip.Root, {
|
|
5343
|
+
defaultOpen,
|
|
5344
|
+
children: [
|
|
5345
|
+
/* @__PURE__ */ jsx104(RadixTooltip.Trigger, {
|
|
5346
|
+
asChild: true,
|
|
5347
|
+
children
|
|
5348
|
+
}),
|
|
5349
|
+
/* @__PURE__ */ jsx104(RadixTooltip.Portal, {
|
|
5350
|
+
children: /* @__PURE__ */ jsxs89(RadixTooltip.Content, {
|
|
5351
|
+
align,
|
|
5352
|
+
className: "c-tooltip-content data-[state=delayed-open]:data-[side=top]:animate-slideDownAndFade data-[state=delayed-open]:data-[side=right]:animate-slideLeftAndFade data-[state=delayed-open]:data-[side=left]:animate-slideRightAndFade data-[state=delayed-open]:data-[side=bottom]:animate-slideUpAndFade",
|
|
5353
|
+
sideOffset: 5,
|
|
5354
|
+
side,
|
|
5355
|
+
children: [
|
|
5356
|
+
/* @__PURE__ */ jsx104(RadixTooltip.Arrow, {
|
|
5357
|
+
className: "c-tooltip-arrow"
|
|
5358
|
+
}),
|
|
5359
|
+
content
|
|
5360
|
+
]
|
|
5361
|
+
})
|
|
5362
|
+
})
|
|
5363
|
+
]
|
|
5364
|
+
})
|
|
5365
|
+
});
|
|
5366
|
+
}
|
|
5367
|
+
|
|
5329
5368
|
// src/input-with-label/input-with-label.tsx
|
|
5330
|
-
import { Fragment, jsx as
|
|
5369
|
+
import { Fragment, jsx as jsx105, jsxs as jsxs90 } from "react/jsx-runtime";
|
|
5331
5370
|
var inputWithLabelStyles = cva9(["c-input-with-label"], {
|
|
5332
5371
|
variants: {
|
|
5333
5372
|
variant: {
|
|
@@ -5344,26 +5383,28 @@ var inputWithLabelStyles = cva9(["c-input-with-label"], {
|
|
|
5344
5383
|
var InputWithLabel = forwardRef93(
|
|
5345
5384
|
({ className, label, append, errorMessage, status, variant, id, labelProps, ...delegated }, ref) => {
|
|
5346
5385
|
const { className: labelClassName, ...labelPropsRest } = labelProps ?? {};
|
|
5347
|
-
return /* @__PURE__ */
|
|
5348
|
-
children: /* @__PURE__ */
|
|
5386
|
+
return /* @__PURE__ */ jsx105(Fragment, {
|
|
5387
|
+
children: /* @__PURE__ */ jsxs90(Label2, {
|
|
5349
5388
|
className: inputWithLabelStyles({ status, variant, className: labelClassName }),
|
|
5350
5389
|
htmlFor: id,
|
|
5351
5390
|
...labelPropsRest,
|
|
5352
5391
|
children: [
|
|
5353
5392
|
label,
|
|
5354
|
-
/* @__PURE__ */
|
|
5393
|
+
/* @__PURE__ */ jsxs90("span", {
|
|
5355
5394
|
className: "c-input-with-label-input-wrap",
|
|
5356
5395
|
children: [
|
|
5357
|
-
/* @__PURE__ */
|
|
5396
|
+
/* @__PURE__ */ jsx105(Input, {
|
|
5358
5397
|
className: cx8("c-input-with-label-input", className),
|
|
5359
5398
|
ref,
|
|
5360
5399
|
id,
|
|
5361
5400
|
...delegated
|
|
5362
5401
|
}),
|
|
5363
|
-
!append && !errorMessage ? null : /* @__PURE__ */
|
|
5364
|
-
|
|
5365
|
-
|
|
5366
|
-
|
|
5402
|
+
!append && !errorMessage ? null : /* @__PURE__ */ jsx105(Tooltip, {
|
|
5403
|
+
content: errorMessage,
|
|
5404
|
+
children: /* @__PURE__ */ jsx105("div", {
|
|
5405
|
+
className: "c-input-with-label-append",
|
|
5406
|
+
children: errorMessage ? /* @__PURE__ */ jsx105(Triangle, {}) : append
|
|
5407
|
+
})
|
|
5367
5408
|
})
|
|
5368
5409
|
]
|
|
5369
5410
|
})
|
|
@@ -5377,12 +5418,12 @@ InputWithLabel.displayName = "InputWithLabel";
|
|
|
5377
5418
|
// src/progress/progress.tsx
|
|
5378
5419
|
import { cx as cx9 } from "class-variance-authority";
|
|
5379
5420
|
import * as ProgressPrimitives from "@radix-ui/react-progress";
|
|
5380
|
-
import { jsx as
|
|
5421
|
+
import { jsx as jsx106 } from "react/jsx-runtime";
|
|
5381
5422
|
function Progress({ className, value }) {
|
|
5382
|
-
return /* @__PURE__ */
|
|
5423
|
+
return /* @__PURE__ */ jsx106(ProgressPrimitives.Root, {
|
|
5383
5424
|
className: cx9(className, "c-progress-root"),
|
|
5384
5425
|
value,
|
|
5385
|
-
children: /* @__PURE__ */
|
|
5426
|
+
children: /* @__PURE__ */ jsx106(ProgressPrimitives.Indicator, {
|
|
5386
5427
|
className: "c-progress-indicator",
|
|
5387
5428
|
style: { transform: `translateX(-${100 - (value ?? 0)}%)` }
|
|
5388
5429
|
})
|
|
@@ -5391,12 +5432,12 @@ function Progress({ className, value }) {
|
|
|
5391
5432
|
|
|
5392
5433
|
// src/radio/radio.tsx
|
|
5393
5434
|
import * as RadioGroupPrimitive2 from "@radix-ui/react-radio-group";
|
|
5394
|
-
import { jsx as
|
|
5435
|
+
import { jsx as jsx107 } from "react/jsx-runtime";
|
|
5395
5436
|
function RadioGroupItem(props) {
|
|
5396
|
-
return /* @__PURE__ */
|
|
5437
|
+
return /* @__PURE__ */ jsx107(RadioGroupPrimitive2.Item, {
|
|
5397
5438
|
...props,
|
|
5398
5439
|
className: "c-radio-item",
|
|
5399
|
-
children: /* @__PURE__ */
|
|
5440
|
+
children: /* @__PURE__ */ jsx107(RadioGroupPrimitive2.Indicator, {
|
|
5400
5441
|
className: "c-radio-indicator"
|
|
5401
5442
|
})
|
|
5402
5443
|
});
|
|
@@ -5409,18 +5450,18 @@ var Radio = {
|
|
|
5409
5450
|
// src/select/select-item.tsx
|
|
5410
5451
|
import { forwardRef as forwardRef94 } from "react";
|
|
5411
5452
|
import * as SelectPrimitives from "@radix-ui/react-select";
|
|
5412
|
-
import { jsx as
|
|
5453
|
+
import { jsx as jsx108, jsxs as jsxs91 } from "react/jsx-runtime";
|
|
5413
5454
|
var SelectItem = forwardRef94((props, ref) => {
|
|
5414
5455
|
const { children, ...delegated } = props;
|
|
5415
|
-
return /* @__PURE__ */
|
|
5456
|
+
return /* @__PURE__ */ jsxs91(SelectPrimitives.Item, {
|
|
5416
5457
|
className: "c-select-item",
|
|
5417
5458
|
ref,
|
|
5418
5459
|
...delegated,
|
|
5419
5460
|
children: [
|
|
5420
|
-
/* @__PURE__ */
|
|
5461
|
+
/* @__PURE__ */ jsx108(SelectPrimitives.ItemText, {
|
|
5421
5462
|
children
|
|
5422
5463
|
}),
|
|
5423
|
-
/* @__PURE__ */
|
|
5464
|
+
/* @__PURE__ */ jsx108(SelectPrimitives.ItemIndicator, {})
|
|
5424
5465
|
]
|
|
5425
5466
|
});
|
|
5426
5467
|
});
|
|
@@ -5430,7 +5471,7 @@ SelectItem.displayName = "SelectItem";
|
|
|
5430
5471
|
import { forwardRef as forwardRef95 } from "react";
|
|
5431
5472
|
import { cva as cva10 } from "class-variance-authority";
|
|
5432
5473
|
import * as SelectPrimitives2 from "@radix-ui/react-select";
|
|
5433
|
-
import { jsx as
|
|
5474
|
+
import { jsx as jsx109, jsxs as jsxs92 } from "react/jsx-runtime";
|
|
5434
5475
|
var selectTriggerStyles = cva10("c-select-trigger", {
|
|
5435
5476
|
variants: {
|
|
5436
5477
|
size: {
|
|
@@ -5446,34 +5487,34 @@ var selectTriggerStyles = cva10("c-select-trigger", {
|
|
|
5446
5487
|
});
|
|
5447
5488
|
var SelectContainer = forwardRef95(
|
|
5448
5489
|
({ children, id, placeholder, disabled, size, ...delegated }, ref) => {
|
|
5449
|
-
return /* @__PURE__ */
|
|
5490
|
+
return /* @__PURE__ */ jsxs92(SelectPrimitives2.Root, {
|
|
5450
5491
|
...delegated,
|
|
5451
5492
|
children: [
|
|
5452
|
-
/* @__PURE__ */
|
|
5493
|
+
/* @__PURE__ */ jsxs92(SelectPrimitives2.Trigger, {
|
|
5453
5494
|
ref,
|
|
5454
5495
|
className: selectTriggerStyles({ size }),
|
|
5455
5496
|
disabled,
|
|
5456
5497
|
id,
|
|
5457
5498
|
children: [
|
|
5458
|
-
/* @__PURE__ */
|
|
5459
|
-
placeholder: /* @__PURE__ */
|
|
5499
|
+
/* @__PURE__ */ jsx109(SelectPrimitives2.Value, {
|
|
5500
|
+
placeholder: /* @__PURE__ */ jsx109("span", {
|
|
5460
5501
|
className: "c-select-value",
|
|
5461
5502
|
children: placeholder ?? "Select..."
|
|
5462
5503
|
})
|
|
5463
5504
|
}),
|
|
5464
|
-
/* @__PURE__ */
|
|
5505
|
+
/* @__PURE__ */ jsx109(Icon.Arrow, {})
|
|
5465
5506
|
]
|
|
5466
5507
|
}),
|
|
5467
|
-
/* @__PURE__ */
|
|
5468
|
-
children: /* @__PURE__ */
|
|
5508
|
+
/* @__PURE__ */ jsx109(SelectPrimitives2.Portal, {
|
|
5509
|
+
children: /* @__PURE__ */ jsxs92(SelectPrimitives2.Content, {
|
|
5469
5510
|
className: "c-select-content",
|
|
5470
5511
|
children: [
|
|
5471
|
-
/* @__PURE__ */
|
|
5472
|
-
/* @__PURE__ */
|
|
5512
|
+
/* @__PURE__ */ jsx109(SelectPrimitives2.ScrollUpButton, {}),
|
|
5513
|
+
/* @__PURE__ */ jsx109(SelectPrimitives2.Viewport, {
|
|
5473
5514
|
className: "c-select-viewport",
|
|
5474
5515
|
children
|
|
5475
5516
|
}),
|
|
5476
|
-
/* @__PURE__ */
|
|
5517
|
+
/* @__PURE__ */ jsx109(SelectPrimitives2.ScrollDownButton, {})
|
|
5477
5518
|
]
|
|
5478
5519
|
})
|
|
5479
5520
|
})
|
|
@@ -5493,20 +5534,20 @@ var Select = {
|
|
|
5493
5534
|
import { forwardRef as forwardRef96 } from "react";
|
|
5494
5535
|
import { cx as cx10 } from "class-variance-authority";
|
|
5495
5536
|
import * as SliderPrimitive from "@radix-ui/react-slider";
|
|
5496
|
-
import { jsx as
|
|
5537
|
+
import { jsx as jsx110, jsxs as jsxs93 } from "react/jsx-runtime";
|
|
5497
5538
|
var Slider = forwardRef96(({ className, transparentRange, ...delegated }, ref) => {
|
|
5498
|
-
return /* @__PURE__ */
|
|
5539
|
+
return /* @__PURE__ */ jsxs93(SliderPrimitive.Root, {
|
|
5499
5540
|
className: cx10("c-slider-root", className),
|
|
5500
5541
|
ref,
|
|
5501
5542
|
...delegated,
|
|
5502
5543
|
children: [
|
|
5503
|
-
/* @__PURE__ */
|
|
5544
|
+
/* @__PURE__ */ jsx110(SliderPrimitive.Track, {
|
|
5504
5545
|
className: "c-slider-track",
|
|
5505
|
-
children: /* @__PURE__ */
|
|
5546
|
+
children: /* @__PURE__ */ jsx110(SliderPrimitive.Range, {
|
|
5506
5547
|
className: `c-slider-range ${transparentRange ? "c-slider-range-transparent" : ""}`
|
|
5507
5548
|
})
|
|
5508
5549
|
}),
|
|
5509
|
-
/* @__PURE__ */
|
|
5550
|
+
/* @__PURE__ */ jsx110(SliderPrimitive.Thumb, {
|
|
5510
5551
|
className: "c-slider-thumb"
|
|
5511
5552
|
})
|
|
5512
5553
|
]
|
|
@@ -5515,7 +5556,7 @@ var Slider = forwardRef96(({ className, transparentRange, ...delegated }, ref) =
|
|
|
5515
5556
|
|
|
5516
5557
|
// src/tag/tag.tsx
|
|
5517
5558
|
import { cva as cva11 } from "class-variance-authority";
|
|
5518
|
-
import { jsx as
|
|
5559
|
+
import { jsx as jsx111, jsxs as jsxs94 } from "react/jsx-runtime";
|
|
5519
5560
|
var tagStyles = cva11("c-tag", {
|
|
5520
5561
|
variants: {
|
|
5521
5562
|
variant: {
|
|
@@ -5535,16 +5576,16 @@ var tagStyles = cva11("c-tag", {
|
|
|
5535
5576
|
}
|
|
5536
5577
|
});
|
|
5537
5578
|
function Tag({ children, className, variant, size, prepend, onRemove, ...delegated }) {
|
|
5538
|
-
return /* @__PURE__ */
|
|
5579
|
+
return /* @__PURE__ */ jsxs94("div", {
|
|
5539
5580
|
className: tagStyles({ className, variant, size }),
|
|
5540
5581
|
...delegated,
|
|
5541
5582
|
children: [
|
|
5542
|
-
!prepend ? null : /* @__PURE__ */
|
|
5583
|
+
!prepend ? null : /* @__PURE__ */ jsx111("span", {
|
|
5543
5584
|
className: "c-tag__prepend",
|
|
5544
5585
|
children: prepend
|
|
5545
5586
|
}),
|
|
5546
5587
|
children,
|
|
5547
|
-
onRemove && /* @__PURE__ */
|
|
5588
|
+
onRemove && /* @__PURE__ */ jsxs94("button", {
|
|
5548
5589
|
type: "button",
|
|
5549
5590
|
className: "c-tag__remove-button",
|
|
5550
5591
|
onClick: (e) => {
|
|
@@ -5552,11 +5593,11 @@ function Tag({ children, className, variant, size, prepend, onRemove, ...delegat
|
|
|
5552
5593
|
onRemove();
|
|
5553
5594
|
},
|
|
5554
5595
|
children: [
|
|
5555
|
-
/* @__PURE__ */
|
|
5596
|
+
/* @__PURE__ */ jsx111(Icon.Cancel, {
|
|
5556
5597
|
width: 12,
|
|
5557
5598
|
height: 12
|
|
5558
5599
|
}),
|
|
5559
|
-
/* @__PURE__ */
|
|
5600
|
+
/* @__PURE__ */ jsx111("span", {
|
|
5560
5601
|
className: "sr-only",
|
|
5561
5602
|
children: "Remove"
|
|
5562
5603
|
})
|
|
@@ -5585,11 +5626,11 @@ import { ContentEditable } from "@lexical/react/LexicalContentEditable";
|
|
|
5585
5626
|
// src/rich-text-editor/context/SharedHistoryContext.tsx
|
|
5586
5627
|
import { createContext, useContext, useMemo } from "react";
|
|
5587
5628
|
import { createEmptyHistoryState } from "@lexical/react/LexicalHistoryPlugin";
|
|
5588
|
-
import { jsx as
|
|
5629
|
+
import { jsx as jsx112 } from "react/jsx-runtime";
|
|
5589
5630
|
var Context = createContext({});
|
|
5590
5631
|
var SharedHistoryContext = ({ children }) => {
|
|
5591
5632
|
const historyContext = useMemo(() => ({ historyState: createEmptyHistoryState() }), []);
|
|
5592
|
-
return /* @__PURE__ */
|
|
5633
|
+
return /* @__PURE__ */ jsx112(Context.Provider, {
|
|
5593
5634
|
value: historyContext,
|
|
5594
5635
|
children
|
|
5595
5636
|
});
|
|
@@ -5666,14 +5707,14 @@ var translations = {
|
|
|
5666
5707
|
var en_default = translations;
|
|
5667
5708
|
|
|
5668
5709
|
// src/rich-text-editor/i18n/index.tsx
|
|
5669
|
-
import { jsx as
|
|
5710
|
+
import { jsx as jsx113 } from "react/jsx-runtime";
|
|
5670
5711
|
var I18nContext = createContext2(null);
|
|
5671
5712
|
function I18nProvider({
|
|
5672
5713
|
labelTranslations,
|
|
5673
5714
|
children
|
|
5674
5715
|
}) {
|
|
5675
5716
|
const translations2 = labelTranslations || en_default;
|
|
5676
|
-
return /* @__PURE__ */
|
|
5717
|
+
return /* @__PURE__ */ jsx113(I18nContext.Provider, {
|
|
5677
5718
|
value: translations2,
|
|
5678
5719
|
children
|
|
5679
5720
|
});
|
|
@@ -6129,7 +6170,7 @@ var BaseNodes = [
|
|
|
6129
6170
|
// src/rich-text-editor/plugins/AutoLinkPlugin/index.tsx
|
|
6130
6171
|
import "react";
|
|
6131
6172
|
import { AutoLinkPlugin } from "@lexical/react/LexicalAutoLinkPlugin";
|
|
6132
|
-
import { jsx as
|
|
6173
|
+
import { jsx as jsx114 } from "react/jsx-runtime";
|
|
6133
6174
|
var URL_MATCHER = /((https?:\/\/(www\.)?)|(www\.))[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)/;
|
|
6134
6175
|
var EMAIL_MATCHER = /(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))/;
|
|
6135
6176
|
var MATCHERS = [
|
|
@@ -6157,7 +6198,7 @@ var MATCHERS = [
|
|
|
6157
6198
|
}
|
|
6158
6199
|
];
|
|
6159
6200
|
function LexicalAutoLinkPlugin() {
|
|
6160
|
-
return /* @__PURE__ */
|
|
6201
|
+
return /* @__PURE__ */ jsx114(AutoLinkPlugin, {
|
|
6161
6202
|
matchers: MATCHERS
|
|
6162
6203
|
});
|
|
6163
6204
|
}
|
|
@@ -6176,7 +6217,7 @@ import { useState } from "react";
|
|
|
6176
6217
|
import { $getNearestNodeFromDOMNode, $getSelection, $setSelection } from "lexical";
|
|
6177
6218
|
import { useDebouncedCallback } from "use-debounce";
|
|
6178
6219
|
import { $isCodeNode as $isCodeNode2 } from "@lexical/code";
|
|
6179
|
-
import { jsx as
|
|
6220
|
+
import { jsx as jsx115 } from "react/jsx-runtime";
|
|
6180
6221
|
function CopyButton({ editor, getCodeDOMNode }) {
|
|
6181
6222
|
const [isCopyCompleted, setCopyCompleted] = useState(false);
|
|
6182
6223
|
const tr = useTr();
|
|
@@ -6205,13 +6246,13 @@ function CopyButton({ editor, getCodeDOMNode }) {
|
|
|
6205
6246
|
console.error("Failed to copy: ", err);
|
|
6206
6247
|
}
|
|
6207
6248
|
}
|
|
6208
|
-
return /* @__PURE__ */
|
|
6249
|
+
return /* @__PURE__ */ jsx115("button", {
|
|
6209
6250
|
className: "c-rte-code-button",
|
|
6210
6251
|
onClick: handleClick,
|
|
6211
6252
|
"aria-label": tr("actionCopyCode"),
|
|
6212
|
-
children: isCopyCompleted ? /* @__PURE__ */
|
|
6253
|
+
children: isCopyCompleted ? /* @__PURE__ */ jsx115("i", {
|
|
6213
6254
|
className: "c-rte-code-button__icon c-rte-icon-success"
|
|
6214
|
-
}) : /* @__PURE__ */
|
|
6255
|
+
}) : /* @__PURE__ */ jsx115("i", {
|
|
6215
6256
|
className: "c-rte-code-button__icon c-rte-icon-copy"
|
|
6216
6257
|
})
|
|
6217
6258
|
});
|
|
@@ -6222,7 +6263,7 @@ import "react";
|
|
|
6222
6263
|
import { useState as useState2 } from "react";
|
|
6223
6264
|
import { $getNearestNodeFromDOMNode as $getNearestNodeFromDOMNode2 } from "lexical";
|
|
6224
6265
|
import { $isCodeNode as $isCodeNode3 } from "@lexical/code";
|
|
6225
|
-
import { jsx as
|
|
6266
|
+
import { jsx as jsx116, jsxs as jsxs95 } from "react/jsx-runtime";
|
|
6226
6267
|
var PRETTIER_PARSER_MODULES = {
|
|
6227
6268
|
css: () => import("./parser-postcss-AN2EJ77H.mjs"),
|
|
6228
6269
|
html: () => import("./parser-html-URMUOK6U.mjs"),
|
|
@@ -6308,22 +6349,22 @@ function PrettierButton({ lang, editor, getCodeDOMNode }) {
|
|
|
6308
6349
|
setTipsVisible(false);
|
|
6309
6350
|
}
|
|
6310
6351
|
}
|
|
6311
|
-
return /* @__PURE__ */
|
|
6352
|
+
return /* @__PURE__ */ jsxs95("div", {
|
|
6312
6353
|
className: "c-rte-prettier-wrapper",
|
|
6313
6354
|
children: [
|
|
6314
|
-
/* @__PURE__ */
|
|
6355
|
+
/* @__PURE__ */ jsx116("button", {
|
|
6315
6356
|
className: "c-rte-code-button",
|
|
6316
6357
|
onClick: handleClick,
|
|
6317
6358
|
onMouseEnter: handleMouseEnter,
|
|
6318
6359
|
onMouseLeave: handleMouseLeave,
|
|
6319
6360
|
"aria-label": tr("actionFormatCode"),
|
|
6320
|
-
children: syntaxError ? /* @__PURE__ */
|
|
6361
|
+
children: syntaxError ? /* @__PURE__ */ jsx116("i", {
|
|
6321
6362
|
className: "c-rte-code-button__icon c-rte-icon-prettier-error"
|
|
6322
|
-
}) : /* @__PURE__ */
|
|
6363
|
+
}) : /* @__PURE__ */ jsx116("i", {
|
|
6323
6364
|
className: "c-rte-code-button__icon c-rte-icon-prettier"
|
|
6324
6365
|
})
|
|
6325
6366
|
}),
|
|
6326
|
-
tipsVisible ? /* @__PURE__ */
|
|
6367
|
+
tipsVisible ? /* @__PURE__ */ jsx116("pre", {
|
|
6327
6368
|
className: "c-rte-code-error-tips",
|
|
6328
6369
|
children: syntaxError
|
|
6329
6370
|
}) : null
|
|
@@ -6332,7 +6373,7 @@ function PrettierButton({ lang, editor, getCodeDOMNode }) {
|
|
|
6332
6373
|
}
|
|
6333
6374
|
|
|
6334
6375
|
// src/rich-text-editor/plugins/CodeActionMenuPlugin/index.tsx
|
|
6335
|
-
import { Fragment as Fragment2, jsx as
|
|
6376
|
+
import { Fragment as Fragment2, jsx as jsx117, jsxs as jsxs96 } from "react/jsx-runtime";
|
|
6336
6377
|
var CODE_PADDING = 0;
|
|
6337
6378
|
function CodeActionMenuContainer({ anchorElem }) {
|
|
6338
6379
|
const [editor] = useLexicalComposerContext();
|
|
@@ -6409,20 +6450,20 @@ function CodeActionMenuContainer({ anchorElem }) {
|
|
|
6409
6450
|
});
|
|
6410
6451
|
const normalizedLang = normalizeCodeLang(lang);
|
|
6411
6452
|
const codeFriendlyName = getLanguageFriendlyName(lang);
|
|
6412
|
-
return /* @__PURE__ */
|
|
6413
|
-
children: isShown ? /* @__PURE__ */
|
|
6453
|
+
return /* @__PURE__ */ jsx117(Fragment2, {
|
|
6454
|
+
children: isShown ? /* @__PURE__ */ jsxs96("div", {
|
|
6414
6455
|
className: "c-rte-code-action-menu-container",
|
|
6415
6456
|
style: { ...position },
|
|
6416
6457
|
children: [
|
|
6417
|
-
/* @__PURE__ */
|
|
6458
|
+
/* @__PURE__ */ jsx117("div", {
|
|
6418
6459
|
className: "c-rte-code-highlight-language",
|
|
6419
6460
|
children: codeFriendlyName
|
|
6420
6461
|
}),
|
|
6421
|
-
/* @__PURE__ */
|
|
6462
|
+
/* @__PURE__ */ jsx117(CopyButton, {
|
|
6422
6463
|
editor,
|
|
6423
6464
|
getCodeDOMNode
|
|
6424
6465
|
}),
|
|
6425
|
-
canBePrettier(normalizedLang) ? /* @__PURE__ */
|
|
6466
|
+
canBePrettier(normalizedLang) ? /* @__PURE__ */ jsx117(PrettierButton, {
|
|
6426
6467
|
editor,
|
|
6427
6468
|
getCodeDOMNode,
|
|
6428
6469
|
lang: normalizedLang
|
|
@@ -6444,7 +6485,7 @@ function getMouseInfo(event) {
|
|
|
6444
6485
|
function CodeActionMenuPlugin({
|
|
6445
6486
|
anchorElem = document.body
|
|
6446
6487
|
}) {
|
|
6447
|
-
return createPortal(/* @__PURE__ */
|
|
6488
|
+
return createPortal(/* @__PURE__ */ jsx117(CodeActionMenuContainer, {
|
|
6448
6489
|
anchorElem
|
|
6449
6490
|
}), anchorElem);
|
|
6450
6491
|
}
|
|
@@ -6463,7 +6504,7 @@ function CodeHighlightPlugin() {
|
|
|
6463
6504
|
|
|
6464
6505
|
// src/rich-text-editor/plugins/DimensionsDetectorPlugin/index.tsx
|
|
6465
6506
|
import { useEffect as useEffect3, useRef as useRef2, useState as useState4 } from "react";
|
|
6466
|
-
import { jsx as
|
|
6507
|
+
import { jsx as jsx118 } from "react/jsx-runtime";
|
|
6467
6508
|
function DimensionDetectorPlugin({ onChange }) {
|
|
6468
6509
|
const [dimensions, setDimensions] = useState4();
|
|
6469
6510
|
const ref = useRef2(null);
|
|
@@ -6492,7 +6533,7 @@ function DimensionDetectorPlugin({ onChange }) {
|
|
|
6492
6533
|
onChange(dimensions);
|
|
6493
6534
|
}
|
|
6494
6535
|
}, [dimensions, onChange]);
|
|
6495
|
-
return /* @__PURE__ */
|
|
6536
|
+
return /* @__PURE__ */ jsx118("div", {
|
|
6496
6537
|
ref,
|
|
6497
6538
|
style: { height: 1, marginTop: -1 }
|
|
6498
6539
|
});
|
|
@@ -6519,7 +6560,7 @@ import { $findMatchingParent, mergeRegister } from "@lexical/utils";
|
|
|
6519
6560
|
import { Suspense, useEffect as useEffect4, useState as useState5 } from "react";
|
|
6520
6561
|
import { $getSelection as $getSelection2, $isTextNode as $isTextNode3 } from "lexical";
|
|
6521
6562
|
import { useLexicalComposerContext as useLexicalComposerContext3 } from "@lexical/react/LexicalComposerContext";
|
|
6522
|
-
import { Fragment as Fragment3, jsx as
|
|
6563
|
+
import { Fragment as Fragment3, jsx as jsx119, jsxs as jsxs97 } from "react/jsx-runtime";
|
|
6523
6564
|
var PREVIEW_CACHE = {};
|
|
6524
6565
|
var URL_MATCHER2 = /((https?:\/\/(www\.)?)|(www\.))[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)/;
|
|
6525
6566
|
function useSuspenseRequest(url) {
|
|
@@ -6576,26 +6617,26 @@ function LinkPreviewContent({
|
|
|
6576
6617
|
if (!hasPreview) {
|
|
6577
6618
|
return null;
|
|
6578
6619
|
}
|
|
6579
|
-
return /* @__PURE__ */
|
|
6620
|
+
return /* @__PURE__ */ jsxs97("div", {
|
|
6580
6621
|
className: "c-rte-link-preview",
|
|
6581
6622
|
children: [
|
|
6582
|
-
preview.google.image && /* @__PURE__ */
|
|
6623
|
+
preview.google.image && /* @__PURE__ */ jsx119("div", {
|
|
6583
6624
|
className: "c-rte-link-preview-image-wrapper",
|
|
6584
|
-
children: /* @__PURE__ */
|
|
6625
|
+
children: /* @__PURE__ */ jsx119("img", {
|
|
6585
6626
|
src: preview.google.image,
|
|
6586
6627
|
alt: preview.google.title,
|
|
6587
6628
|
className: "c-rte-link-preview-image"
|
|
6588
6629
|
})
|
|
6589
6630
|
}),
|
|
6590
|
-
preview.google.title && /* @__PURE__ */
|
|
6631
|
+
preview.google.title && /* @__PURE__ */ jsx119("div", {
|
|
6591
6632
|
className: "c-rte-link-preview-title",
|
|
6592
6633
|
children: preview.google.title
|
|
6593
6634
|
}),
|
|
6594
|
-
preview.google.description && /* @__PURE__ */
|
|
6635
|
+
preview.google.description && /* @__PURE__ */ jsx119("div", {
|
|
6595
6636
|
className: "c-rte-link-preview-description",
|
|
6596
6637
|
children: preview.google.description
|
|
6597
6638
|
}),
|
|
6598
|
-
textContent && textContent !== preview.google.title ? /* @__PURE__ */
|
|
6639
|
+
textContent && textContent !== preview.google.title ? /* @__PURE__ */ jsx119(Button, {
|
|
6599
6640
|
className: "c-rte-link-preview__replace-text-btn",
|
|
6600
6641
|
onClick: useTitleForText,
|
|
6601
6642
|
children: tr("linkPreviewReplaceTextWithTitle")
|
|
@@ -6604,7 +6645,7 @@ function LinkPreviewContent({
|
|
|
6604
6645
|
});
|
|
6605
6646
|
}
|
|
6606
6647
|
function Glimmer(props) {
|
|
6607
|
-
return /* @__PURE__ */
|
|
6648
|
+
return /* @__PURE__ */ jsx119("div", {
|
|
6608
6649
|
className: "c-rte-link-preview-glimmer",
|
|
6609
6650
|
...props,
|
|
6610
6651
|
style: {
|
|
@@ -6616,24 +6657,24 @@ function Glimmer(props) {
|
|
|
6616
6657
|
function LinkPreview({
|
|
6617
6658
|
url
|
|
6618
6659
|
}) {
|
|
6619
|
-
return /* @__PURE__ */
|
|
6620
|
-
fallback: /* @__PURE__ */
|
|
6660
|
+
return /* @__PURE__ */ jsx119(Suspense, {
|
|
6661
|
+
fallback: /* @__PURE__ */ jsxs97(Fragment3, {
|
|
6621
6662
|
children: [
|
|
6622
|
-
/* @__PURE__ */
|
|
6663
|
+
/* @__PURE__ */ jsx119(Glimmer, {
|
|
6623
6664
|
style: { height: "80px" },
|
|
6624
6665
|
index: 0
|
|
6625
6666
|
}),
|
|
6626
|
-
/* @__PURE__ */
|
|
6667
|
+
/* @__PURE__ */ jsx119(Glimmer, {
|
|
6627
6668
|
style: { width: "60%" },
|
|
6628
6669
|
index: 1
|
|
6629
6670
|
}),
|
|
6630
|
-
/* @__PURE__ */
|
|
6671
|
+
/* @__PURE__ */ jsx119(Glimmer, {
|
|
6631
6672
|
style: { width: "80%" },
|
|
6632
6673
|
index: 2
|
|
6633
6674
|
})
|
|
6634
6675
|
]
|
|
6635
6676
|
}),
|
|
6636
|
-
children: /* @__PURE__ */
|
|
6677
|
+
children: /* @__PURE__ */ jsx119(LinkPreviewContent, {
|
|
6637
6678
|
url
|
|
6638
6679
|
})
|
|
6639
6680
|
});
|
|
@@ -6701,7 +6742,7 @@ function validateUrl(url) {
|
|
|
6701
6742
|
}
|
|
6702
6743
|
|
|
6703
6744
|
// src/rich-text-editor/plugins/FloatingLinkEditorPlugin/index.tsx
|
|
6704
|
-
import { Fragment as Fragment4, jsx as
|
|
6745
|
+
import { Fragment as Fragment4, jsx as jsx120, jsxs as jsxs98 } from "react/jsx-runtime";
|
|
6705
6746
|
function FloatingLinkEditor({
|
|
6706
6747
|
editor,
|
|
6707
6748
|
isLink,
|
|
@@ -6822,41 +6863,41 @@ function FloatingLinkEditor({
|
|
|
6822
6863
|
inputRef.current.focus();
|
|
6823
6864
|
}
|
|
6824
6865
|
}, [isEditMode]);
|
|
6825
|
-
return /* @__PURE__ */
|
|
6866
|
+
return /* @__PURE__ */ jsx120("div", {
|
|
6826
6867
|
ref: editorRef,
|
|
6827
6868
|
className: "c-rte-link-editor",
|
|
6828
|
-
children: isEditMode ? /* @__PURE__ */
|
|
6869
|
+
children: isEditMode ? /* @__PURE__ */ jsxs98("div", {
|
|
6829
6870
|
children: [
|
|
6830
|
-
/* @__PURE__ */
|
|
6871
|
+
/* @__PURE__ */ jsx120("div", {
|
|
6831
6872
|
className: "c-rte-link-editor-input-group",
|
|
6832
|
-
children: /* @__PURE__ */
|
|
6873
|
+
children: /* @__PURE__ */ jsx120(InputWithLabel, {
|
|
6833
6874
|
label: tr("linkEditorLink"),
|
|
6834
6875
|
type: "text",
|
|
6835
6876
|
value: linkUrl,
|
|
6836
6877
|
onChange: (e) => setLinkUrl(e.target.value)
|
|
6837
6878
|
})
|
|
6838
6879
|
}),
|
|
6839
|
-
/* @__PURE__ */
|
|
6880
|
+
/* @__PURE__ */ jsx120("div", {
|
|
6840
6881
|
className: "c-rte-link-editor-input-group",
|
|
6841
|
-
children: /* @__PURE__ */
|
|
6882
|
+
children: /* @__PURE__ */ jsx120(InputWithLabel, {
|
|
6842
6883
|
label: tr("linkEditorRel"),
|
|
6843
6884
|
type: "text",
|
|
6844
6885
|
value: rel ?? "",
|
|
6845
6886
|
onChange: (e) => setRel(e.target.value)
|
|
6846
6887
|
})
|
|
6847
6888
|
}),
|
|
6848
|
-
/* @__PURE__ */
|
|
6889
|
+
/* @__PURE__ */ jsx120("div", {
|
|
6849
6890
|
className: "c-rte-link-editor-input-group",
|
|
6850
|
-
children: /* @__PURE__ */
|
|
6891
|
+
children: /* @__PURE__ */ jsx120(InputWithLabel, {
|
|
6851
6892
|
label: tr("linkEditorTarget"),
|
|
6852
6893
|
type: "text",
|
|
6853
6894
|
value: target ?? "",
|
|
6854
6895
|
onChange: (e) => setTarget(e.target.value)
|
|
6855
6896
|
})
|
|
6856
6897
|
}),
|
|
6857
|
-
/* @__PURE__ */
|
|
6898
|
+
/* @__PURE__ */ jsx120("div", {
|
|
6858
6899
|
className: "c-rte-link-editor-button-wrap",
|
|
6859
|
-
children: /* @__PURE__ */
|
|
6900
|
+
children: /* @__PURE__ */ jsx120(Button, {
|
|
6860
6901
|
onClick: () => {
|
|
6861
6902
|
if (lastSelection !== null) {
|
|
6862
6903
|
if (linkUrl !== "") {
|
|
@@ -6873,28 +6914,28 @@ function FloatingLinkEditor({
|
|
|
6873
6914
|
})
|
|
6874
6915
|
})
|
|
6875
6916
|
]
|
|
6876
|
-
}) : /* @__PURE__ */
|
|
6917
|
+
}) : /* @__PURE__ */ jsxs98(Fragment4, {
|
|
6877
6918
|
children: [
|
|
6878
|
-
/* @__PURE__ */
|
|
6919
|
+
/* @__PURE__ */ jsxs98("div", {
|
|
6879
6920
|
className: "c-rte-link-editor-link-input",
|
|
6880
6921
|
children: [
|
|
6881
|
-
/* @__PURE__ */
|
|
6922
|
+
/* @__PURE__ */ jsxs98("div", {
|
|
6882
6923
|
className: "c-rte-link-editor-link-preview",
|
|
6883
6924
|
children: [
|
|
6884
|
-
/* @__PURE__ */
|
|
6925
|
+
/* @__PURE__ */ jsx120("a", {
|
|
6885
6926
|
href: linkUrl,
|
|
6886
6927
|
target: "_blank",
|
|
6887
6928
|
rel: "noopener noreferrer",
|
|
6888
6929
|
children: linkUrl
|
|
6889
6930
|
}),
|
|
6890
|
-
rel || target ? /* @__PURE__ */
|
|
6931
|
+
rel || target ? /* @__PURE__ */ jsxs98("div", {
|
|
6891
6932
|
className: "c-rte-link-editor-preview-attrs",
|
|
6892
6933
|
children: [
|
|
6893
|
-
rel && /* @__PURE__ */
|
|
6934
|
+
rel && /* @__PURE__ */ jsx120("div", {
|
|
6894
6935
|
className: "c-rte-link-editor-preview-attr",
|
|
6895
6936
|
children: rel
|
|
6896
6937
|
}),
|
|
6897
|
-
target && /* @__PURE__ */
|
|
6938
|
+
target && /* @__PURE__ */ jsx120("div", {
|
|
6898
6939
|
className: "c-rte-link-editor-preview-attr",
|
|
6899
6940
|
children: target
|
|
6900
6941
|
})
|
|
@@ -6902,20 +6943,20 @@ function FloatingLinkEditor({
|
|
|
6902
6943
|
}) : null
|
|
6903
6944
|
]
|
|
6904
6945
|
}),
|
|
6905
|
-
/* @__PURE__ */
|
|
6906
|
-
children: /* @__PURE__ */
|
|
6946
|
+
/* @__PURE__ */ jsx120("div", {
|
|
6947
|
+
children: /* @__PURE__ */ jsx120(IconButton, {
|
|
6907
6948
|
size: "sm",
|
|
6908
6949
|
tabIndex: 0,
|
|
6909
6950
|
onMouseDown: (event) => event.preventDefault(),
|
|
6910
6951
|
onClick: () => setEditMode(true),
|
|
6911
6952
|
"aria-label": tr("linkEditorEdit"),
|
|
6912
|
-
children: /* @__PURE__ */
|
|
6953
|
+
children: /* @__PURE__ */ jsx120(Icon.Edit, {})
|
|
6913
6954
|
})
|
|
6914
6955
|
})
|
|
6915
6956
|
]
|
|
6916
6957
|
}),
|
|
6917
|
-
/* @__PURE__ */
|
|
6918
|
-
children: /* @__PURE__ */
|
|
6958
|
+
/* @__PURE__ */ jsx120("div", {
|
|
6959
|
+
children: /* @__PURE__ */ jsx120(LinkPreview, {
|
|
6919
6960
|
url: linkUrl
|
|
6920
6961
|
})
|
|
6921
6962
|
})
|
|
@@ -6951,7 +6992,7 @@ function useFloatingLinkEditorToolbar(editor, anchorElem) {
|
|
|
6951
6992
|
);
|
|
6952
6993
|
}, [editor, updateToolbar]);
|
|
6953
6994
|
return isLink ? createPortal2(
|
|
6954
|
-
/* @__PURE__ */
|
|
6995
|
+
/* @__PURE__ */ jsx120(FloatingLinkEditor, {
|
|
6955
6996
|
editor: activeEditor,
|
|
6956
6997
|
isLink,
|
|
6957
6998
|
anchorElem,
|
|
@@ -7017,7 +7058,7 @@ function getDOMRangeRect(nativeSelection, rootElement) {
|
|
|
7017
7058
|
}
|
|
7018
7059
|
|
|
7019
7060
|
// src/rich-text-editor/plugins/FloatingTextFormatToolbarPlugin/index.tsx
|
|
7020
|
-
import { jsx as
|
|
7061
|
+
import { jsx as jsx121, jsxs as jsxs99 } from "react/jsx-runtime";
|
|
7021
7062
|
function TextFormatFloatingToolbar({
|
|
7022
7063
|
editor,
|
|
7023
7064
|
anchorElem,
|
|
@@ -7091,93 +7132,93 @@ function TextFormatFloatingToolbar({
|
|
|
7091
7132
|
);
|
|
7092
7133
|
}, [editor, updateTextFormatFloatingToolbar]);
|
|
7093
7134
|
if (!editor.isEditable()) {
|
|
7094
|
-
return /* @__PURE__ */
|
|
7135
|
+
return /* @__PURE__ */ jsx121("span", {});
|
|
7095
7136
|
}
|
|
7096
|
-
return /* @__PURE__ */
|
|
7137
|
+
return /* @__PURE__ */ jsxs99("div", {
|
|
7097
7138
|
ref: popupCharStylesEditorRef,
|
|
7098
7139
|
className: "c-rte-floating-text-format-tb-plugin",
|
|
7099
7140
|
children: [
|
|
7100
|
-
/* @__PURE__ */
|
|
7141
|
+
/* @__PURE__ */ jsx121(IconButton, {
|
|
7101
7142
|
onClick: () => {
|
|
7102
7143
|
editor.dispatchCommand(FORMAT_TEXT_COMMAND, "bold");
|
|
7103
7144
|
},
|
|
7104
7145
|
style: { padding: 0, overflow: "hidden" },
|
|
7105
7146
|
title: tr(IS_APPLE ? "actionFormatAsStrongTitleApple" : "actionFormatAsStrongTitle"),
|
|
7106
7147
|
"aria-label": tr("actionFormatAsStrongLabel"),
|
|
7107
|
-
children: /* @__PURE__ */
|
|
7148
|
+
children: /* @__PURE__ */ jsx121("i", {
|
|
7108
7149
|
className: `c-rte-icon-bold c-rte-floating-text-format-tb-plugin__format-icon ${isBold ? "selected" : ""}`
|
|
7109
7150
|
})
|
|
7110
7151
|
}),
|
|
7111
|
-
/* @__PURE__ */
|
|
7152
|
+
/* @__PURE__ */ jsx121(IconButton, {
|
|
7112
7153
|
style: { padding: 0, overflow: "hidden" },
|
|
7113
7154
|
onClick: () => {
|
|
7114
7155
|
editor.dispatchCommand(FORMAT_TEXT_COMMAND, "italic");
|
|
7115
7156
|
},
|
|
7116
7157
|
title: tr("actionFormatAsEmphasizedTitle"),
|
|
7117
7158
|
"aria-label": tr("actionFormatAsEmphasizedLabel"),
|
|
7118
|
-
children: /* @__PURE__ */
|
|
7159
|
+
children: /* @__PURE__ */ jsx121("i", {
|
|
7119
7160
|
className: `c-rte-icon-italic c-rte-floating-text-format-tb-plugin__format-icon ${isItalic ? "selected" : ""}`
|
|
7120
7161
|
})
|
|
7121
7162
|
}),
|
|
7122
|
-
/* @__PURE__ */
|
|
7163
|
+
/* @__PURE__ */ jsx121(IconButton, {
|
|
7123
7164
|
style: { padding: 0, overflow: "hidden" },
|
|
7124
7165
|
onClick: () => {
|
|
7125
7166
|
editor.dispatchCommand(FORMAT_TEXT_COMMAND, "underline");
|
|
7126
7167
|
},
|
|
7127
7168
|
title: tr("actionFormatAsUnderlinedTitle"),
|
|
7128
7169
|
"aria-label": tr("actionFormatAsUnderlinedLabel"),
|
|
7129
|
-
children: /* @__PURE__ */
|
|
7170
|
+
children: /* @__PURE__ */ jsx121("i", {
|
|
7130
7171
|
className: `c-rte-icon-underline c-rte-floating-text-format-tb-plugin__format-icon ${isUnderline ? "selected" : ""}`
|
|
7131
7172
|
})
|
|
7132
7173
|
}),
|
|
7133
|
-
/* @__PURE__ */
|
|
7174
|
+
/* @__PURE__ */ jsx121(IconButton, {
|
|
7134
7175
|
style: { padding: 0, overflow: "hidden" },
|
|
7135
7176
|
onClick: () => {
|
|
7136
7177
|
editor.dispatchCommand(FORMAT_TEXT_COMMAND, "strikethrough");
|
|
7137
7178
|
},
|
|
7138
7179
|
title: tr("actionFormatWithStrikethroughTitle"),
|
|
7139
7180
|
"aria-label": tr("actionFormatWithStrikethroughLabel"),
|
|
7140
|
-
children: /* @__PURE__ */
|
|
7181
|
+
children: /* @__PURE__ */ jsx121("i", {
|
|
7141
7182
|
className: `c-rte-icon-strikethrough c-rte-floating-text-format-tb-plugin__format-icon ${isStrikethrough ? "selected" : ""}`
|
|
7142
7183
|
})
|
|
7143
7184
|
}),
|
|
7144
|
-
/* @__PURE__ */
|
|
7185
|
+
/* @__PURE__ */ jsx121(IconButton, {
|
|
7145
7186
|
style: { padding: 0, overflow: "hidden" },
|
|
7146
7187
|
onClick: () => {
|
|
7147
7188
|
editor.dispatchCommand(FORMAT_TEXT_COMMAND, "subscript");
|
|
7148
7189
|
},
|
|
7149
7190
|
title: tr("actionFormatWithSubscriptTitle"),
|
|
7150
7191
|
"aria-label": tr("actionFormatWithSubscriptLabel"),
|
|
7151
|
-
children: /* @__PURE__ */
|
|
7192
|
+
children: /* @__PURE__ */ jsx121("i", {
|
|
7152
7193
|
className: `c-rte-icon-subscript c-rte-floating-text-format-tb-plugin__format-icon ${isSubscript ? "selected" : ""}`
|
|
7153
7194
|
})
|
|
7154
7195
|
}),
|
|
7155
|
-
/* @__PURE__ */
|
|
7196
|
+
/* @__PURE__ */ jsx121(IconButton, {
|
|
7156
7197
|
style: { padding: 0, overflow: "hidden" },
|
|
7157
7198
|
onClick: () => {
|
|
7158
7199
|
editor.dispatchCommand(FORMAT_TEXT_COMMAND, "superscript");
|
|
7159
7200
|
},
|
|
7160
7201
|
title: tr("actionFormatWithSuperscriptTitle"),
|
|
7161
7202
|
"aria-label": tr("actionFormatWithSuperscriptLabel"),
|
|
7162
|
-
children: /* @__PURE__ */
|
|
7203
|
+
children: /* @__PURE__ */ jsx121("i", {
|
|
7163
7204
|
className: `c-rte-icon-superscript c-rte-floating-text-format-tb-plugin__format-icon ${isSuperscript ? "selected" : ""}`
|
|
7164
7205
|
})
|
|
7165
7206
|
}),
|
|
7166
|
-
/* @__PURE__ */
|
|
7207
|
+
/* @__PURE__ */ jsx121(IconButton, {
|
|
7167
7208
|
style: { padding: 0, overflow: "hidden" },
|
|
7168
7209
|
onClick: () => {
|
|
7169
7210
|
editor.dispatchCommand(FORMAT_TEXT_COMMAND, "code");
|
|
7170
7211
|
},
|
|
7171
7212
|
"aria-label": tr("actionInsertCodeBlock"),
|
|
7172
|
-
children: /* @__PURE__ */
|
|
7213
|
+
children: /* @__PURE__ */ jsx121("i", {
|
|
7173
7214
|
className: `c-rte-icon-code c-rte-floating-text-format-tb-plugin__format-icon ${isCode ? "selected" : ""}`
|
|
7174
7215
|
})
|
|
7175
7216
|
}),
|
|
7176
|
-
/* @__PURE__ */
|
|
7217
|
+
/* @__PURE__ */ jsx121(IconButton, {
|
|
7177
7218
|
style: { padding: 0, overflow: "hidden" },
|
|
7178
7219
|
onClick: insertLink,
|
|
7179
7220
|
"aria-label": tr("actionInsertlink"),
|
|
7180
|
-
children: /* @__PURE__ */
|
|
7221
|
+
children: /* @__PURE__ */ jsx121("i", {
|
|
7181
7222
|
className: `c-rte-icon-link c-rte-floating-text-format-tb-plugin__format-icon ${isLink ? "selected" : ""}`
|
|
7182
7223
|
})
|
|
7183
7224
|
})
|
|
@@ -7252,7 +7293,7 @@ function useFloatingTextFormatToolbar(editor, anchorElem) {
|
|
|
7252
7293
|
return null;
|
|
7253
7294
|
}
|
|
7254
7295
|
return createPortal3(
|
|
7255
|
-
/* @__PURE__ */
|
|
7296
|
+
/* @__PURE__ */ jsx121(TextFormatFloatingToolbar, {
|
|
7256
7297
|
editor,
|
|
7257
7298
|
anchorElem,
|
|
7258
7299
|
isLink,
|
|
@@ -7277,9 +7318,9 @@ function FloatingTextFormatToolbarPlugin({
|
|
|
7277
7318
|
// src/rich-text-editor/plugins/LinkPlugin/index.tsx
|
|
7278
7319
|
import "react";
|
|
7279
7320
|
import { LinkPlugin as LexicalLinkPlugin } from "@lexical/react/LexicalLinkPlugin";
|
|
7280
|
-
import { jsx as
|
|
7321
|
+
import { jsx as jsx122 } from "react/jsx-runtime";
|
|
7281
7322
|
function LinkPlugin() {
|
|
7282
|
-
return /* @__PURE__ */
|
|
7323
|
+
return /* @__PURE__ */ jsx122(LexicalLinkPlugin, {
|
|
7283
7324
|
validateUrl
|
|
7284
7325
|
});
|
|
7285
7326
|
}
|
|
@@ -7472,7 +7513,7 @@ import {
|
|
|
7472
7513
|
TableCellHeaderStates,
|
|
7473
7514
|
TableCellNode as TableCellNode2
|
|
7474
7515
|
} from "@lexical/table";
|
|
7475
|
-
import { Fragment as Fragment5, jsx as
|
|
7516
|
+
import { Fragment as Fragment5, jsx as jsx123, jsxs as jsxs100 } from "react/jsx-runtime";
|
|
7476
7517
|
function TableActionMenu({ tableCellNode: _tableCellNode, tableStats }) {
|
|
7477
7518
|
const [editor] = useLexicalComposerContext9();
|
|
7478
7519
|
const [tableCellNode, updateTableCellNode] = useState8(_tableCellNode);
|
|
@@ -7627,46 +7668,46 @@ function TableActionMenu({ tableCellNode: _tableCellNode, tableStats }) {
|
|
|
7627
7668
|
clearTableSelection();
|
|
7628
7669
|
});
|
|
7629
7670
|
}, [editor, tableCellNode, clearTableSelection]);
|
|
7630
|
-
return /* @__PURE__ */
|
|
7671
|
+
return /* @__PURE__ */ jsxs100(Fragment5, {
|
|
7631
7672
|
children: [
|
|
7632
|
-
/* @__PURE__ */
|
|
7673
|
+
/* @__PURE__ */ jsx123(DropdownMenu.Item, {
|
|
7633
7674
|
onSelect: () => insertTableRowAtSelection(false),
|
|
7634
7675
|
children: tr("actionTableInsertRowsAbove", selectionCounts.rows)
|
|
7635
7676
|
}),
|
|
7636
|
-
/* @__PURE__ */
|
|
7677
|
+
/* @__PURE__ */ jsx123(DropdownMenu.Item, {
|
|
7637
7678
|
onSelect: () => insertTableRowAtSelection(true),
|
|
7638
7679
|
children: tr("actionTableInsertRowsBelow", selectionCounts.rows)
|
|
7639
7680
|
}),
|
|
7640
|
-
/* @__PURE__ */
|
|
7681
|
+
/* @__PURE__ */ jsx123(DropdownMenu.Item, {
|
|
7641
7682
|
onSelect: () => insertTableColumnAtSelection(false),
|
|
7642
7683
|
children: tr("actionTableInsertColumnsBefore", selectionCounts.columns)
|
|
7643
7684
|
}),
|
|
7644
|
-
/* @__PURE__ */
|
|
7685
|
+
/* @__PURE__ */ jsx123(DropdownMenu.Item, {
|
|
7645
7686
|
onSelect: () => insertTableColumnAtSelection(true),
|
|
7646
7687
|
children: tr("actionTableInsertColumnsAfter", selectionCounts.columns)
|
|
7647
7688
|
}),
|
|
7648
|
-
/* @__PURE__ */
|
|
7689
|
+
/* @__PURE__ */ jsx123(DropdownMenu.Item, {
|
|
7649
7690
|
onSelect: () => toggleTableRowIsHeader(),
|
|
7650
7691
|
children: tr(
|
|
7651
7692
|
(tableCellNode.__headerState & TableCellHeaderStates.ROW) === TableCellHeaderStates.ROW ? "actionTableRemoveRowHeader" : "actionTableAddRowHeader"
|
|
7652
7693
|
)
|
|
7653
7694
|
}),
|
|
7654
|
-
/* @__PURE__ */
|
|
7695
|
+
/* @__PURE__ */ jsx123(DropdownMenu.Item, {
|
|
7655
7696
|
onSelect: () => toggleTableColumnIsHeader(),
|
|
7656
7697
|
children: tr(
|
|
7657
7698
|
(tableCellNode.__headerState & TableCellHeaderStates.COLUMN) === TableCellHeaderStates.COLUMN ? "actionTableRemoveColumnHeader" : "actionTableAddColumnHeader"
|
|
7658
7699
|
)
|
|
7659
7700
|
}),
|
|
7660
|
-
/* @__PURE__ */
|
|
7661
|
-
tableStats.columns > 1 && /* @__PURE__ */
|
|
7701
|
+
/* @__PURE__ */ jsx123(DropdownMenu.Separator, {}),
|
|
7702
|
+
tableStats.columns > 1 && /* @__PURE__ */ jsx123(DropdownMenu.Item, {
|
|
7662
7703
|
onSelect: () => deleteTableColumnAtSelection(),
|
|
7663
7704
|
children: tr("actionTableDeleteColumn")
|
|
7664
7705
|
}),
|
|
7665
|
-
tableStats.rows > 1 && /* @__PURE__ */
|
|
7706
|
+
tableStats.rows > 1 && /* @__PURE__ */ jsx123(DropdownMenu.Item, {
|
|
7666
7707
|
onSelect: () => deleteTableRowAtSelection(),
|
|
7667
7708
|
children: tr("actionTableDeleteRow")
|
|
7668
7709
|
}),
|
|
7669
|
-
/* @__PURE__ */
|
|
7710
|
+
/* @__PURE__ */ jsx123(DropdownMenu.Item, {
|
|
7670
7711
|
onSelect: () => deleteTableAtSelection(),
|
|
7671
7712
|
children: tr("actionTableDeleteTable")
|
|
7672
7713
|
})
|
|
@@ -7748,19 +7789,19 @@ function TableCellActionMenuContainer({ anchorElem }) {
|
|
|
7748
7789
|
}
|
|
7749
7790
|
}
|
|
7750
7791
|
}, [menuButtonRef, tableCellNode, editor, anchorElem]);
|
|
7751
|
-
return /* @__PURE__ */
|
|
7792
|
+
return /* @__PURE__ */ jsx123("div", {
|
|
7752
7793
|
className: "c-rte-table-cell-action-button-container",
|
|
7753
7794
|
ref: menuButtonRef,
|
|
7754
|
-
children: tableCellNode != null && /* @__PURE__ */
|
|
7795
|
+
children: tableCellNode != null && /* @__PURE__ */ jsx123(DropdownMenu.Root, {
|
|
7755
7796
|
onOpenChange: (isOpen) => setIsMenuOpen(isOpen),
|
|
7756
|
-
content: /* @__PURE__ */
|
|
7797
|
+
content: /* @__PURE__ */ jsx123(TableActionMenu, {
|
|
7757
7798
|
tableCellNode,
|
|
7758
7799
|
tableStats
|
|
7759
7800
|
}),
|
|
7760
|
-
children: /* @__PURE__ */
|
|
7801
|
+
children: /* @__PURE__ */ jsx123(IconButton, {
|
|
7761
7802
|
size: "xs",
|
|
7762
7803
|
"aria-label": tr("actionTableOpenOptions"),
|
|
7763
|
-
children: /* @__PURE__ */
|
|
7804
|
+
children: /* @__PURE__ */ jsx123(Icon.Arrow, {})
|
|
7764
7805
|
})
|
|
7765
7806
|
})
|
|
7766
7807
|
});
|
|
@@ -7769,7 +7810,7 @@ function TableActionMenuPlugin({
|
|
|
7769
7810
|
anchorElem = document.body
|
|
7770
7811
|
}) {
|
|
7771
7812
|
const isEditable = useLexicalEditable();
|
|
7772
|
-
return createPortal4(isEditable ? /* @__PURE__ */
|
|
7813
|
+
return createPortal4(isEditable ? /* @__PURE__ */ jsx123(TableCellActionMenuContainer, {
|
|
7773
7814
|
anchorElem
|
|
7774
7815
|
}) : null, anchorElem);
|
|
7775
7816
|
}
|
|
@@ -7824,7 +7865,7 @@ import {
|
|
|
7824
7865
|
import { useRef as useRef6 } from "react";
|
|
7825
7866
|
import { CLEAR_EDITOR_COMMAND } from "lexical";
|
|
7826
7867
|
import { useLexicalComposerContext as useLexicalComposerContext10 } from "@lexical/react/LexicalComposerContext";
|
|
7827
|
-
import { jsx as
|
|
7868
|
+
import { jsx as jsx124, jsxs as jsxs101 } from "react/jsx-runtime";
|
|
7828
7869
|
async function copyJson(editor) {
|
|
7829
7870
|
const json = lexicalToCrystallizeRichText({ editor, editorState: editor.getEditorState() });
|
|
7830
7871
|
try {
|
|
@@ -7840,22 +7881,22 @@ function ActionsPlugin({
|
|
|
7840
7881
|
const [editor] = useLexicalComposerContext10();
|
|
7841
7882
|
const tr = useTr();
|
|
7842
7883
|
const actionMenuAnchorRef = useRef6(null);
|
|
7843
|
-
return /* @__PURE__ */
|
|
7884
|
+
return /* @__PURE__ */ jsx124("div", {
|
|
7844
7885
|
ref: actionMenuAnchorRef,
|
|
7845
7886
|
className: "c-rte-actions-plugin",
|
|
7846
|
-
children: /* @__PURE__ */
|
|
7887
|
+
children: /* @__PURE__ */ jsxs101(ActionMenu, {
|
|
7847
7888
|
container: actionMenuAnchorRef.current,
|
|
7848
7889
|
children: [
|
|
7849
|
-
!prepend ? null : prepend.map((actionItem) => /* @__PURE__ */
|
|
7890
|
+
!prepend ? null : prepend.map((actionItem) => /* @__PURE__ */ jsx124(ActionMenu.Item, {
|
|
7850
7891
|
onSelect: actionItem.action,
|
|
7851
7892
|
className: actionItem.type === "danger" ? "danger" : "",
|
|
7852
7893
|
children: actionItem.title
|
|
7853
7894
|
}, actionItem.title)),
|
|
7854
|
-
/* @__PURE__ */
|
|
7895
|
+
/* @__PURE__ */ jsx124(ActionMenu.Item, {
|
|
7855
7896
|
onSelect: () => copyJson(editor),
|
|
7856
7897
|
children: tr("actionCopyJSON")
|
|
7857
7898
|
}),
|
|
7858
|
-
/* @__PURE__ */
|
|
7899
|
+
/* @__PURE__ */ jsx124(ActionMenu.Item, {
|
|
7859
7900
|
className: "danger",
|
|
7860
7901
|
onSelect: () => {
|
|
7861
7902
|
editor.dispatchCommand(CLEAR_EDITOR_COMMAND, void 0);
|
|
@@ -7863,7 +7904,7 @@ function ActionsPlugin({
|
|
|
7863
7904
|
},
|
|
7864
7905
|
children: tr("actionClear")
|
|
7865
7906
|
}),
|
|
7866
|
-
!append ? null : append.map((actionItem) => /* @__PURE__ */
|
|
7907
|
+
!append ? null : append.map((actionItem) => /* @__PURE__ */ jsx124(ActionMenu.Item, {
|
|
7867
7908
|
onSelect: actionItem.action,
|
|
7868
7909
|
className: actionItem.type === "danger" ? "danger" : "",
|
|
7869
7910
|
children: actionItem.title
|
|
@@ -7876,7 +7917,7 @@ function ActionsPlugin({
|
|
|
7876
7917
|
// src/rich-text-editor/plugins/ToolbarPlugin/insert-table.tsx
|
|
7877
7918
|
import { useState as useState9 } from "react";
|
|
7878
7919
|
import { INSERT_TABLE_COMMAND } from "@lexical/table";
|
|
7879
|
-
import { jsx as
|
|
7920
|
+
import { jsx as jsx125, jsxs as jsxs102 } from "react/jsx-runtime";
|
|
7880
7921
|
function InsertTableDialog({ activeEditor }) {
|
|
7881
7922
|
const [rows, setRows] = useState9("5");
|
|
7882
7923
|
const [columns, setColumns] = useState9("5");
|
|
@@ -7894,13 +7935,13 @@ function InsertTableDialog({ activeEditor }) {
|
|
|
7894
7935
|
}
|
|
7895
7936
|
});
|
|
7896
7937
|
};
|
|
7897
|
-
return /* @__PURE__ */
|
|
7938
|
+
return /* @__PURE__ */ jsxs102("div", {
|
|
7898
7939
|
className: "c-rte-insert-table",
|
|
7899
7940
|
children: [
|
|
7900
|
-
/* @__PURE__ */
|
|
7941
|
+
/* @__PURE__ */ jsxs102("div", {
|
|
7901
7942
|
className: "c-rte-insert-table__dimensions",
|
|
7902
7943
|
children: [
|
|
7903
|
-
/* @__PURE__ */
|
|
7944
|
+
/* @__PURE__ */ jsx125(InputWithLabel, {
|
|
7904
7945
|
label: tr("insertTableRows"),
|
|
7905
7946
|
value: rows,
|
|
7906
7947
|
placeholder: "0",
|
|
@@ -7908,10 +7949,10 @@ function InsertTableDialog({ activeEditor }) {
|
|
|
7908
7949
|
inputMode: "numeric",
|
|
7909
7950
|
onChange: (e) => setRows(e.target.value)
|
|
7910
7951
|
}),
|
|
7911
|
-
/* @__PURE__ */
|
|
7952
|
+
/* @__PURE__ */ jsx125("span", {
|
|
7912
7953
|
className: "c-rte-insert-table__dimensions__separator"
|
|
7913
7954
|
}),
|
|
7914
|
-
/* @__PURE__ */
|
|
7955
|
+
/* @__PURE__ */ jsx125(InputWithLabel, {
|
|
7915
7956
|
type: "text",
|
|
7916
7957
|
label: tr("insertTableColumns"),
|
|
7917
7958
|
placeholder: "0",
|
|
@@ -7921,9 +7962,9 @@ function InsertTableDialog({ activeEditor }) {
|
|
|
7921
7962
|
})
|
|
7922
7963
|
]
|
|
7923
7964
|
}),
|
|
7924
|
-
/* @__PURE__ */
|
|
7965
|
+
/* @__PURE__ */ jsx125("div", {
|
|
7925
7966
|
className: "c-rte-insert-table__actions",
|
|
7926
|
-
children: /* @__PURE__ */
|
|
7967
|
+
children: /* @__PURE__ */ jsx125(Button, {
|
|
7927
7968
|
as: Dialog.Close,
|
|
7928
7969
|
size: "sm",
|
|
7929
7970
|
intent: "action",
|
|
@@ -7937,7 +7978,7 @@ function InsertTableDialog({ activeEditor }) {
|
|
|
7937
7978
|
}
|
|
7938
7979
|
|
|
7939
7980
|
// src/rich-text-editor/plugins/ToolbarPlugin/index.tsx
|
|
7940
|
-
import { Fragment as Fragment6, jsx as
|
|
7981
|
+
import { Fragment as Fragment6, jsx as jsx126, jsxs as jsxs103 } from "react/jsx-runtime";
|
|
7941
7982
|
var headingTypeToBlockName = {
|
|
7942
7983
|
h1: "Heading 1",
|
|
7943
7984
|
h2: "Heading 2",
|
|
@@ -8041,80 +8082,80 @@ function BlockFormatDropDown({
|
|
|
8041
8082
|
});
|
|
8042
8083
|
}
|
|
8043
8084
|
};
|
|
8044
|
-
return /* @__PURE__ */
|
|
8085
|
+
return /* @__PURE__ */ jsx126(DropdownMenu.Root, {
|
|
8045
8086
|
disabled,
|
|
8046
8087
|
style: { zIndex: 1 },
|
|
8047
|
-
content: /* @__PURE__ */
|
|
8088
|
+
content: /* @__PURE__ */ jsxs103(Fragment6, {
|
|
8048
8089
|
children: [
|
|
8049
|
-
/* @__PURE__ */
|
|
8090
|
+
/* @__PURE__ */ jsxs103(DropdownMenu.Item, {
|
|
8050
8091
|
onClick: formatParagraph,
|
|
8051
8092
|
children: [
|
|
8052
|
-
/* @__PURE__ */
|
|
8093
|
+
/* @__PURE__ */ jsx126("i", {
|
|
8053
8094
|
className: `c-rte-icon-paragraph c-rte-toolbar__block-format__icon ${blockType === "paragraph" ? "selected" : ""}`
|
|
8054
8095
|
}),
|
|
8055
|
-
/* @__PURE__ */
|
|
8096
|
+
/* @__PURE__ */ jsx126("span", {
|
|
8056
8097
|
className: `c-rte-toolbar__block-format__text ${blockType === "paragraph" ? "selected" : ""}`,
|
|
8057
8098
|
children: "Normal"
|
|
8058
8099
|
})
|
|
8059
8100
|
]
|
|
8060
8101
|
}),
|
|
8061
|
-
headings.map((headingSize) => /* @__PURE__ */
|
|
8102
|
+
headings.map((headingSize) => /* @__PURE__ */ jsxs103(DropdownMenu.Item, {
|
|
8062
8103
|
onClick: () => formatHeading(headingSize),
|
|
8063
8104
|
children: [
|
|
8064
|
-
/* @__PURE__ */
|
|
8105
|
+
/* @__PURE__ */ jsx126("i", {
|
|
8065
8106
|
className: `c-rte-icon-${headingSize} c-rte-toolbar__block-format__icon ${blockType === headingSize ? "selected" : ""}`
|
|
8066
8107
|
}),
|
|
8067
|
-
/* @__PURE__ */
|
|
8108
|
+
/* @__PURE__ */ jsx126("span", {
|
|
8068
8109
|
className: `c-rte-toolbar__block-format__text ${blockType === headingSize ? "selected" : ""}`,
|
|
8069
8110
|
children: headingTypeToBlockName[headingSize]
|
|
8070
8111
|
})
|
|
8071
8112
|
]
|
|
8072
8113
|
}, headingSize)),
|
|
8073
|
-
/* @__PURE__ */
|
|
8114
|
+
/* @__PURE__ */ jsxs103(DropdownMenu.Item, {
|
|
8074
8115
|
onClick: formatBulletList,
|
|
8075
8116
|
children: [
|
|
8076
|
-
/* @__PURE__ */
|
|
8117
|
+
/* @__PURE__ */ jsx126("i", {
|
|
8077
8118
|
className: `c-rte-icon-bullet-list c-rte-toolbar__block-format__icon ${blockType === "bullet" ? "selected" : ""}`
|
|
8078
8119
|
}),
|
|
8079
|
-
/* @__PURE__ */
|
|
8120
|
+
/* @__PURE__ */ jsx126("span", {
|
|
8080
8121
|
className: `c-rte-toolbar__block-format__text ${blockType === "bullet" ? "selected" : ""}`,
|
|
8081
8122
|
children: "Bullet List"
|
|
8082
8123
|
})
|
|
8083
8124
|
]
|
|
8084
8125
|
}),
|
|
8085
|
-
/* @__PURE__ */
|
|
8126
|
+
/* @__PURE__ */ jsxs103(DropdownMenu.Item, {
|
|
8086
8127
|
onClick: formatNumberedList,
|
|
8087
8128
|
children: [
|
|
8088
|
-
/* @__PURE__ */
|
|
8129
|
+
/* @__PURE__ */ jsx126("i", {
|
|
8089
8130
|
className: `c-rte-icon-numbered-list c-rte-toolbar__block-format__icon ${blockType === "number" ? "selected" : ""}`
|
|
8090
8131
|
}),
|
|
8091
|
-
/* @__PURE__ */
|
|
8132
|
+
/* @__PURE__ */ jsx126("span", {
|
|
8092
8133
|
className: `c-rte-toolbar__block-format__text ${blockType === "number" ? "selected" : ""}`,
|
|
8093
8134
|
children: "Numbered List"
|
|
8094
8135
|
})
|
|
8095
8136
|
]
|
|
8096
8137
|
}),
|
|
8097
|
-
/* @__PURE__ */
|
|
8138
|
+
/* @__PURE__ */ jsxs103(DropdownMenu.Item, {
|
|
8098
8139
|
onClick: formatQuote,
|
|
8099
8140
|
"data-testid": "toggle-block-format-quote",
|
|
8100
8141
|
children: [
|
|
8101
|
-
/* @__PURE__ */
|
|
8142
|
+
/* @__PURE__ */ jsx126("i", {
|
|
8102
8143
|
className: `c-rte-icon-quote c-rte-toolbar__block-format__icon ${blockType === "quote" ? "selected" : ""}`
|
|
8103
8144
|
}),
|
|
8104
|
-
/* @__PURE__ */
|
|
8145
|
+
/* @__PURE__ */ jsx126("span", {
|
|
8105
8146
|
className: `c-rte-toolbar__block-format__text ${blockType === "quote" ? "selected" : ""}`,
|
|
8106
8147
|
children: "Quote"
|
|
8107
8148
|
})
|
|
8108
8149
|
]
|
|
8109
8150
|
}),
|
|
8110
|
-
/* @__PURE__ */
|
|
8151
|
+
/* @__PURE__ */ jsxs103(DropdownMenu.Item, {
|
|
8111
8152
|
onClick: formatCode,
|
|
8112
8153
|
"data-testid": "toggle-block-format-code",
|
|
8113
8154
|
children: [
|
|
8114
|
-
/* @__PURE__ */
|
|
8155
|
+
/* @__PURE__ */ jsx126("i", {
|
|
8115
8156
|
className: `icon c-rte-icon-code border w-6 h-6 rounded-md bg-no-repeat bg-center bg-[length:18px_18px] ${blockType === "code" ? "selected" : ""}`
|
|
8116
8157
|
}),
|
|
8117
|
-
/* @__PURE__ */
|
|
8158
|
+
/* @__PURE__ */ jsx126("span", {
|
|
8118
8159
|
className: `c-rte-toolbar__block-format__text ${blockType === "code" ? "selected" : ""}`,
|
|
8119
8160
|
children: "Code block"
|
|
8120
8161
|
})
|
|
@@ -8122,21 +8163,21 @@ function BlockFormatDropDown({
|
|
|
8122
8163
|
})
|
|
8123
8164
|
]
|
|
8124
8165
|
}),
|
|
8125
|
-
children: /* @__PURE__ */
|
|
8166
|
+
children: /* @__PURE__ */ jsxs103(Button, {
|
|
8126
8167
|
style: { backgroundColor: "transparent", padding: "0 8px" },
|
|
8127
8168
|
"aria-label": "Formatting options for text style",
|
|
8128
8169
|
"data-testid": "toggle-block-format",
|
|
8129
8170
|
children: [
|
|
8130
|
-
/* @__PURE__ */
|
|
8171
|
+
/* @__PURE__ */ jsx126("i", {
|
|
8131
8172
|
className: `c-rte-toolbar__toggle-icon c-rte-icon-${blockType}`
|
|
8132
8173
|
}),
|
|
8133
|
-
/* @__PURE__ */
|
|
8174
|
+
/* @__PURE__ */ jsx126(Icon.Arrow, {})
|
|
8134
8175
|
]
|
|
8135
8176
|
})
|
|
8136
8177
|
});
|
|
8137
8178
|
}
|
|
8138
8179
|
function Divider() {
|
|
8139
|
-
return /* @__PURE__ */
|
|
8180
|
+
return /* @__PURE__ */ jsx126("div", {
|
|
8140
8181
|
className: "c-rte-toolbar__divider"
|
|
8141
8182
|
});
|
|
8142
8183
|
}
|
|
@@ -8285,13 +8326,13 @@ function ToolbarPlugin({
|
|
|
8285
8326
|
},
|
|
8286
8327
|
[activeEditor, selectedElementKey]
|
|
8287
8328
|
);
|
|
8288
|
-
return /* @__PURE__ */
|
|
8329
|
+
return /* @__PURE__ */ jsxs103("div", {
|
|
8289
8330
|
className: "c-rte-toolbar",
|
|
8290
8331
|
children: [
|
|
8291
|
-
/* @__PURE__ */
|
|
8332
|
+
/* @__PURE__ */ jsxs103("div", {
|
|
8292
8333
|
className: "c-rte-toolbar__inner",
|
|
8293
8334
|
children: [
|
|
8294
|
-
/* @__PURE__ */
|
|
8335
|
+
/* @__PURE__ */ jsx126(IconButton, {
|
|
8295
8336
|
disabled: !canUndo || !isEditable,
|
|
8296
8337
|
onClick: () => {
|
|
8297
8338
|
activeEditor.dispatchCommand(UNDO_COMMAND, void 0);
|
|
@@ -8299,12 +8340,12 @@ function ToolbarPlugin({
|
|
|
8299
8340
|
type: "button",
|
|
8300
8341
|
title: tr(IS_APPLE ? "actionUndoTitleApple" : "actionUndoTitle"),
|
|
8301
8342
|
"aria-label": tr("actionUndoLabel"),
|
|
8302
|
-
children: /* @__PURE__ */
|
|
8343
|
+
children: /* @__PURE__ */ jsx126("i", {
|
|
8303
8344
|
className: `c-rte-icon-undo c-rte-toolbar__icon ${!canUndo ? "disabled" : ""}
|
|
8304
8345
|
`
|
|
8305
8346
|
})
|
|
8306
8347
|
}),
|
|
8307
|
-
/* @__PURE__ */
|
|
8348
|
+
/* @__PURE__ */ jsx126(IconButton, {
|
|
8308
8349
|
disabled: !canRedo || !isEditable,
|
|
8309
8350
|
onClick: () => {
|
|
8310
8351
|
activeEditor.dispatchCommand(REDO_COMMAND, void 0);
|
|
@@ -8312,51 +8353,51 @@ function ToolbarPlugin({
|
|
|
8312
8353
|
type: "button",
|
|
8313
8354
|
title: tr(IS_APPLE ? "actionRedoTitleApple" : "actionRedoTitle"),
|
|
8314
8355
|
"aria-label": tr("actionRedoLabel"),
|
|
8315
|
-
children: /* @__PURE__ */
|
|
8356
|
+
children: /* @__PURE__ */ jsx126("i", {
|
|
8316
8357
|
className: `c-rte-icon-redo c-rte-toolbar__icon ${!canRedo ? "disabled" : ""}`
|
|
8317
8358
|
})
|
|
8318
8359
|
}),
|
|
8319
|
-
/* @__PURE__ */
|
|
8320
|
-
blockType in blockTypeToBlockName && activeEditor === editor && /* @__PURE__ */
|
|
8360
|
+
/* @__PURE__ */ jsx126(Divider, {}),
|
|
8361
|
+
blockType in blockTypeToBlockName && activeEditor === editor && /* @__PURE__ */ jsxs103(Fragment6, {
|
|
8321
8362
|
children: [
|
|
8322
|
-
/* @__PURE__ */
|
|
8363
|
+
/* @__PURE__ */ jsx126(BlockFormatDropDown, {
|
|
8323
8364
|
disabled: !isEditable,
|
|
8324
8365
|
blockType,
|
|
8325
8366
|
editor
|
|
8326
8367
|
}),
|
|
8327
|
-
/* @__PURE__ */
|
|
8368
|
+
/* @__PURE__ */ jsx126(Divider, {})
|
|
8328
8369
|
]
|
|
8329
8370
|
}),
|
|
8330
|
-
blockType === "code" ? /* @__PURE__ */
|
|
8331
|
-
children: /* @__PURE__ */
|
|
8371
|
+
blockType === "code" ? /* @__PURE__ */ jsx126(Fragment6, {
|
|
8372
|
+
children: /* @__PURE__ */ jsx126(DropdownMenu.Root, {
|
|
8332
8373
|
disabled: !isEditable,
|
|
8333
8374
|
style: { zIndex: 1 },
|
|
8334
|
-
content: /* @__PURE__ */
|
|
8375
|
+
content: /* @__PURE__ */ jsx126(Fragment6, {
|
|
8335
8376
|
children: CODE_LANGUAGE_OPTIONS.map(([value, name]) => {
|
|
8336
|
-
return /* @__PURE__ */
|
|
8377
|
+
return /* @__PURE__ */ jsx126(DropdownMenu.Item, {
|
|
8337
8378
|
className: `item ${dropDownActiveClass(value === codeLanguage)}`,
|
|
8338
8379
|
onClick: () => onCodeLanguageSelect(value),
|
|
8339
|
-
children: /* @__PURE__ */
|
|
8380
|
+
children: /* @__PURE__ */ jsx126("span", {
|
|
8340
8381
|
className: `c-rte-toolbar__code-lang__sel-item ${dropDownActiveClass(value === codeLanguage) ? "selected" : ""}`,
|
|
8341
8382
|
children: name
|
|
8342
8383
|
})
|
|
8343
8384
|
}, value);
|
|
8344
8385
|
})
|
|
8345
8386
|
}),
|
|
8346
|
-
children: /* @__PURE__ */
|
|
8387
|
+
children: /* @__PURE__ */ jsx126(Button, {
|
|
8347
8388
|
"aria-label": tr("codeSelectLanguage"),
|
|
8348
|
-
append: /* @__PURE__ */
|
|
8349
|
-
children: /* @__PURE__ */
|
|
8389
|
+
append: /* @__PURE__ */ jsx126(Icon.Arrow, {}),
|
|
8390
|
+
children: /* @__PURE__ */ jsx126("span", {
|
|
8350
8391
|
className: "c-rte-toolbar__code-lang__button-text",
|
|
8351
8392
|
children: getLanguageFriendlyName2(codeLanguage)
|
|
8352
8393
|
})
|
|
8353
8394
|
})
|
|
8354
8395
|
})
|
|
8355
|
-
}) : /* @__PURE__ */
|
|
8356
|
-
children: /* @__PURE__ */
|
|
8396
|
+
}) : /* @__PURE__ */ jsx126(Dialog, {
|
|
8397
|
+
children: /* @__PURE__ */ jsxs103("div", {
|
|
8357
8398
|
className: "c-rte-toolbar__actions-rest",
|
|
8358
8399
|
children: [
|
|
8359
|
-
/* @__PURE__ */
|
|
8400
|
+
/* @__PURE__ */ jsx126(IconButton, {
|
|
8360
8401
|
disabled: !isEditable,
|
|
8361
8402
|
className: `c-rte-toolbar__icon-btn ${isBold ? "selected" : ""}`,
|
|
8362
8403
|
type: "button",
|
|
@@ -8366,11 +8407,11 @@ function ToolbarPlugin({
|
|
|
8366
8407
|
onClick: () => {
|
|
8367
8408
|
activeEditor.dispatchCommand(FORMAT_TEXT_COMMAND2, "bold");
|
|
8368
8409
|
},
|
|
8369
|
-
children: /* @__PURE__ */
|
|
8410
|
+
children: /* @__PURE__ */ jsx126("i", {
|
|
8370
8411
|
className: `c-rte-toolbar__icon-btn__icon c-rte-icon-bold`
|
|
8371
8412
|
})
|
|
8372
8413
|
}),
|
|
8373
|
-
/* @__PURE__ */
|
|
8414
|
+
/* @__PURE__ */ jsx126(IconButton, {
|
|
8374
8415
|
className: `c-rte-toolbar__icon-btn ${isItalic ? "selected" : ""}`,
|
|
8375
8416
|
disabled: !isEditable,
|
|
8376
8417
|
onClick: () => {
|
|
@@ -8380,11 +8421,11 @@ function ToolbarPlugin({
|
|
|
8380
8421
|
title: tr(IS_APPLE ? "actionFormatAsEmphasizedTitleApple" : "actionFormatAsEmphasizedTitle"),
|
|
8381
8422
|
"aria-label": tr("actionFormatAsEmphasizedLabel"),
|
|
8382
8423
|
"data-testid": "toggle-format-emphasized",
|
|
8383
|
-
children: /* @__PURE__ */
|
|
8424
|
+
children: /* @__PURE__ */ jsx126("i", {
|
|
8384
8425
|
className: `c-rte-toolbar__icon-btn__icon c-rte-icon-italic`
|
|
8385
8426
|
})
|
|
8386
8427
|
}),
|
|
8387
|
-
/* @__PURE__ */
|
|
8428
|
+
/* @__PURE__ */ jsx126(IconButton, {
|
|
8388
8429
|
className: `c-rte-toolbar__icon-btn ${isUnderline ? "selected" : ""}`,
|
|
8389
8430
|
disabled: !isEditable,
|
|
8390
8431
|
onClick: () => {
|
|
@@ -8394,11 +8435,11 @@ function ToolbarPlugin({
|
|
|
8394
8435
|
title: tr(IS_APPLE ? "actionFormatAsUnderlinedTitleApple" : "actionFormatAsUnderlinedTitle"),
|
|
8395
8436
|
"aria-label": tr("actionFormatAsUnderlinedLabel"),
|
|
8396
8437
|
"data-testid": "toggle-format-underlined",
|
|
8397
|
-
children: /* @__PURE__ */
|
|
8438
|
+
children: /* @__PURE__ */ jsx126("i", {
|
|
8398
8439
|
className: `c-rte-toolbar__icon-btn__icon c-rte-icon-underline`
|
|
8399
8440
|
})
|
|
8400
8441
|
}),
|
|
8401
|
-
/* @__PURE__ */
|
|
8442
|
+
/* @__PURE__ */ jsx126(IconButton, {
|
|
8402
8443
|
className: `c-rte-toolbar__icon-btn ${isCode ? "selected" : ""}`,
|
|
8403
8444
|
disabled: !isEditable,
|
|
8404
8445
|
onClick: () => {
|
|
@@ -8407,84 +8448,84 @@ function ToolbarPlugin({
|
|
|
8407
8448
|
type: "button",
|
|
8408
8449
|
title: tr("actionInsertCodeBlock"),
|
|
8409
8450
|
"aria-label": tr("actionInsertCodeBlock"),
|
|
8410
|
-
children: /* @__PURE__ */
|
|
8451
|
+
children: /* @__PURE__ */ jsx126("i", {
|
|
8411
8452
|
className: `c-rte-toolbar__icon-btn__icon c-rte-icon-code`
|
|
8412
8453
|
})
|
|
8413
8454
|
}),
|
|
8414
|
-
/* @__PURE__ */
|
|
8455
|
+
/* @__PURE__ */ jsx126(IconButton, {
|
|
8415
8456
|
className: `c-rte-toolbar__icon-btn ${isLink ? "selected" : ""}`,
|
|
8416
8457
|
disabled: !isEditable,
|
|
8417
8458
|
onClick: insertLink,
|
|
8418
8459
|
type: "button",
|
|
8419
8460
|
"aria-label": tr("actionInsertlink"),
|
|
8420
8461
|
title: tr("actionInsertlink"),
|
|
8421
|
-
children: /* @__PURE__ */
|
|
8462
|
+
children: /* @__PURE__ */ jsx126("i", {
|
|
8422
8463
|
className: `c-rte-toolbar__icon-btn__icon c-rte-icon-link`
|
|
8423
8464
|
})
|
|
8424
8465
|
}),
|
|
8425
|
-
/* @__PURE__ */
|
|
8466
|
+
/* @__PURE__ */ jsx126(DropdownMenu.Root, {
|
|
8426
8467
|
disabled: !isEditable,
|
|
8427
8468
|
style: { zIndex: 1 },
|
|
8428
|
-
content: /* @__PURE__ */
|
|
8469
|
+
content: /* @__PURE__ */ jsxs103(Fragment6, {
|
|
8429
8470
|
children: [
|
|
8430
|
-
/* @__PURE__ */
|
|
8471
|
+
/* @__PURE__ */ jsxs103(DropdownMenu.Item, {
|
|
8431
8472
|
onClick: () => {
|
|
8432
8473
|
activeEditor.dispatchCommand(FORMAT_TEXT_COMMAND2, "strikethrough");
|
|
8433
8474
|
},
|
|
8434
8475
|
title: tr("actionFormatWithStrikethroughTitle"),
|
|
8435
8476
|
"aria-label": tr("actionFormatWithStrikethroughLabel"),
|
|
8436
8477
|
children: [
|
|
8437
|
-
/* @__PURE__ */
|
|
8478
|
+
/* @__PURE__ */ jsx126("i", {
|
|
8438
8479
|
className: `c-rte-icon-strikethrough c-rte-toolbar__dd-item__icon ${isStrikethrough ? "selected" : ""}`
|
|
8439
8480
|
}),
|
|
8440
|
-
/* @__PURE__ */
|
|
8481
|
+
/* @__PURE__ */ jsx126("span", {
|
|
8441
8482
|
className: `c-rte-toolbar__dd-item__text ${isStrikethrough ? "selected" : ""}`,
|
|
8442
8483
|
children: tr("actionFormatAsStrongTitle")
|
|
8443
8484
|
})
|
|
8444
8485
|
]
|
|
8445
8486
|
}),
|
|
8446
|
-
/* @__PURE__ */
|
|
8487
|
+
/* @__PURE__ */ jsxs103(DropdownMenu.Item, {
|
|
8447
8488
|
onClick: () => {
|
|
8448
8489
|
activeEditor.dispatchCommand(FORMAT_TEXT_COMMAND2, "subscript");
|
|
8449
8490
|
},
|
|
8450
8491
|
title: tr("actionFormatWithSubscriptTitle"),
|
|
8451
8492
|
"aria-label": tr("actionFormatWithSubscriptLabel"),
|
|
8452
8493
|
children: [
|
|
8453
|
-
/* @__PURE__ */
|
|
8494
|
+
/* @__PURE__ */ jsx126("i", {
|
|
8454
8495
|
className: `c-rte-icon-subscript c-rte-toolbar__dd-item__icon ${isSubscript ? "selected" : ""}`
|
|
8455
8496
|
}),
|
|
8456
|
-
/* @__PURE__ */
|
|
8497
|
+
/* @__PURE__ */ jsx126("span", {
|
|
8457
8498
|
className: `c-rte-toolbar__dd-item__text ${isSubscript ? "selected" : ""}`,
|
|
8458
8499
|
children: tr("actionFormatWithSubscriptTitle")
|
|
8459
8500
|
})
|
|
8460
8501
|
]
|
|
8461
8502
|
}),
|
|
8462
|
-
/* @__PURE__ */
|
|
8503
|
+
/* @__PURE__ */ jsxs103(DropdownMenu.Item, {
|
|
8463
8504
|
onClick: () => {
|
|
8464
8505
|
activeEditor.dispatchCommand(FORMAT_TEXT_COMMAND2, "superscript");
|
|
8465
8506
|
},
|
|
8466
8507
|
title: tr("actionFormatWithSuperscriptTitle"),
|
|
8467
8508
|
"aria-label": tr("actionFormatWithSuperscriptLabel"),
|
|
8468
8509
|
children: [
|
|
8469
|
-
/* @__PURE__ */
|
|
8510
|
+
/* @__PURE__ */ jsx126("i", {
|
|
8470
8511
|
className: `c-rte-icon-superscript c-rte-toolbar__dd-item__icon ${isSuperscript ? "selected" : ""}`
|
|
8471
8512
|
}),
|
|
8472
|
-
/* @__PURE__ */
|
|
8513
|
+
/* @__PURE__ */ jsx126("span", {
|
|
8473
8514
|
className: `c-rte-toolbar__dd-item__text ${isSuperscript ? "selected" : ""}`,
|
|
8474
8515
|
children: tr("actionFormatWithSuperscriptTitle")
|
|
8475
8516
|
})
|
|
8476
8517
|
]
|
|
8477
8518
|
}),
|
|
8478
|
-
/* @__PURE__ */
|
|
8519
|
+
/* @__PURE__ */ jsxs103(DropdownMenu.Item, {
|
|
8479
8520
|
onClick: clearFormatting,
|
|
8480
8521
|
className: "item",
|
|
8481
8522
|
title: tr("actionClearTextFormatting"),
|
|
8482
8523
|
"aria-label": tr("actionClearTextFormatting"),
|
|
8483
8524
|
children: [
|
|
8484
|
-
/* @__PURE__ */
|
|
8525
|
+
/* @__PURE__ */ jsx126("i", {
|
|
8485
8526
|
className: "c-rte-icon-clear c-rte-toolbar__dd-item__icon"
|
|
8486
8527
|
}),
|
|
8487
|
-
/* @__PURE__ */
|
|
8528
|
+
/* @__PURE__ */ jsx126("span", {
|
|
8488
8529
|
className: "c-rte-toolbar__dd-item__text--clear",
|
|
8489
8530
|
children: "Clear Formatting"
|
|
8490
8531
|
})
|
|
@@ -8492,47 +8533,47 @@ function ToolbarPlugin({
|
|
|
8492
8533
|
})
|
|
8493
8534
|
]
|
|
8494
8535
|
}),
|
|
8495
|
-
children: /* @__PURE__ */
|
|
8536
|
+
children: /* @__PURE__ */ jsxs103(Button, {
|
|
8496
8537
|
style: { backgroundColor: "transparent", padding: "0 8px" },
|
|
8497
8538
|
"aria-label": tr("actionTextFormattingOptions"),
|
|
8498
8539
|
children: [
|
|
8499
|
-
/* @__PURE__ */
|
|
8540
|
+
/* @__PURE__ */ jsx126("i", {
|
|
8500
8541
|
className: `c-rte-icon-dropdown-more c-rte-toolbar__toggle-icon`
|
|
8501
8542
|
}),
|
|
8502
|
-
/* @__PURE__ */
|
|
8543
|
+
/* @__PURE__ */ jsx126(Icon.Arrow, {})
|
|
8503
8544
|
]
|
|
8504
8545
|
})
|
|
8505
8546
|
}),
|
|
8506
|
-
/* @__PURE__ */
|
|
8507
|
-
/* @__PURE__ */
|
|
8547
|
+
/* @__PURE__ */ jsx126(Divider, {}),
|
|
8548
|
+
/* @__PURE__ */ jsx126(DropdownMenu.Root, {
|
|
8508
8549
|
style: { zIndex: 1 },
|
|
8509
8550
|
disabled: !isEditable,
|
|
8510
|
-
content: /* @__PURE__ */
|
|
8551
|
+
content: /* @__PURE__ */ jsxs103(Fragment6, {
|
|
8511
8552
|
children: [
|
|
8512
|
-
/* @__PURE__ */
|
|
8553
|
+
/* @__PURE__ */ jsxs103(DropdownMenu.Item, {
|
|
8513
8554
|
onClick: () => {
|
|
8514
8555
|
activeEditor.dispatchCommand(INSERT_HORIZONTAL_RULE_COMMAND, void 0);
|
|
8515
8556
|
},
|
|
8516
8557
|
children: [
|
|
8517
|
-
/* @__PURE__ */
|
|
8558
|
+
/* @__PURE__ */ jsx126("i", {
|
|
8518
8559
|
className: "c-rte-toolbar__dd-item__icon c-rte-icon-horizontal-rule"
|
|
8519
8560
|
}),
|
|
8520
|
-
/* @__PURE__ */
|
|
8561
|
+
/* @__PURE__ */ jsx126("span", {
|
|
8521
8562
|
className: "c-rte-toolbar__dd-item__text",
|
|
8522
8563
|
children: tr("horizontalRule")
|
|
8523
8564
|
})
|
|
8524
8565
|
]
|
|
8525
8566
|
}),
|
|
8526
|
-
/* @__PURE__ */
|
|
8527
|
-
children: /* @__PURE__ */
|
|
8567
|
+
/* @__PURE__ */ jsx126(DropdownMenu.Item, {
|
|
8568
|
+
children: /* @__PURE__ */ jsx126(Dialog.Trigger, {
|
|
8528
8569
|
asChild: true,
|
|
8529
|
-
children: /* @__PURE__ */
|
|
8570
|
+
children: /* @__PURE__ */ jsxs103("div", {
|
|
8530
8571
|
className: "c-rte-toolbar__dd-item--table",
|
|
8531
8572
|
children: [
|
|
8532
|
-
/* @__PURE__ */
|
|
8573
|
+
/* @__PURE__ */ jsx126("i", {
|
|
8533
8574
|
className: "c-rte-toolbar__dd-item__icon c-rte-icon-table"
|
|
8534
8575
|
}),
|
|
8535
|
-
/* @__PURE__ */
|
|
8576
|
+
/* @__PURE__ */ jsx126("span", {
|
|
8536
8577
|
className: "c-rte-toolbar__dd-item__text",
|
|
8537
8578
|
children: tr("table")
|
|
8538
8579
|
})
|
|
@@ -8542,21 +8583,21 @@ function ToolbarPlugin({
|
|
|
8542
8583
|
})
|
|
8543
8584
|
]
|
|
8544
8585
|
}),
|
|
8545
|
-
children: /* @__PURE__ */
|
|
8546
|
-
children: /* @__PURE__ */
|
|
8586
|
+
children: /* @__PURE__ */ jsx126(IconButton, {
|
|
8587
|
+
children: /* @__PURE__ */ jsx126("i", {
|
|
8547
8588
|
className: "c-rte-icon-plus c-rte-toolbar__plus"
|
|
8548
8589
|
})
|
|
8549
8590
|
})
|
|
8550
8591
|
}),
|
|
8551
|
-
/* @__PURE__ */
|
|
8592
|
+
/* @__PURE__ */ jsxs103(Dialog.Content, {
|
|
8552
8593
|
children: [
|
|
8553
|
-
/* @__PURE__ */
|
|
8594
|
+
/* @__PURE__ */ jsx126(Dialog.Title, {
|
|
8554
8595
|
children: tr("insertTableTitle")
|
|
8555
8596
|
}),
|
|
8556
|
-
/* @__PURE__ */
|
|
8597
|
+
/* @__PURE__ */ jsx126(Dialog.Description, {
|
|
8557
8598
|
children: tr("insertTableDescription")
|
|
8558
8599
|
}),
|
|
8559
|
-
/* @__PURE__ */
|
|
8600
|
+
/* @__PURE__ */ jsx126(InsertTableDialog, {
|
|
8560
8601
|
activeEditor
|
|
8561
8602
|
})
|
|
8562
8603
|
]
|
|
@@ -8566,7 +8607,7 @@ function ToolbarPlugin({
|
|
|
8566
8607
|
})
|
|
8567
8608
|
]
|
|
8568
8609
|
}),
|
|
8569
|
-
/* @__PURE__ */
|
|
8610
|
+
/* @__PURE__ */ jsx126(ActionsPlugin, {
|
|
8570
8611
|
prepend: actionsMenuPrepend,
|
|
8571
8612
|
append: actionsMenuAppend
|
|
8572
8613
|
})
|
|
@@ -8677,14 +8718,14 @@ var theme = {
|
|
|
8677
8718
|
var CrystallizeRTEditorTheme_default = theme;
|
|
8678
8719
|
|
|
8679
8720
|
// src/rich-text-editor/rich-text-editor.tsx
|
|
8680
|
-
import { Fragment as Fragment7, jsx as
|
|
8721
|
+
import { Fragment as Fragment7, jsx as jsx127, jsxs as jsxs104 } from "react/jsx-runtime";
|
|
8681
8722
|
function RichTextEditor({
|
|
8682
8723
|
initialData,
|
|
8683
8724
|
language = "en",
|
|
8684
8725
|
labelTranslations,
|
|
8685
8726
|
...rest
|
|
8686
8727
|
}) {
|
|
8687
|
-
return /* @__PURE__ */
|
|
8728
|
+
return /* @__PURE__ */ jsx127(LexicalComposer, {
|
|
8688
8729
|
initialConfig: {
|
|
8689
8730
|
editable: !rest.disabled,
|
|
8690
8731
|
namespace: "crystallize-rich-text-editor",
|
|
@@ -8697,13 +8738,13 @@ function RichTextEditor({
|
|
|
8697
8738
|
richText: initialData
|
|
8698
8739
|
}) : void 0
|
|
8699
8740
|
},
|
|
8700
|
-
children: /* @__PURE__ */
|
|
8741
|
+
children: /* @__PURE__ */ jsx127(I18nProvider, {
|
|
8701
8742
|
language,
|
|
8702
8743
|
labelTranslations,
|
|
8703
|
-
children: /* @__PURE__ */
|
|
8704
|
-
children: /* @__PURE__ */
|
|
8744
|
+
children: /* @__PURE__ */ jsx127(SharedHistoryContext, {
|
|
8745
|
+
children: /* @__PURE__ */ jsx127("div", {
|
|
8705
8746
|
className: "c-rich-text-editor",
|
|
8706
|
-
children: /* @__PURE__ */
|
|
8747
|
+
children: /* @__PURE__ */ jsx127(RichTextEditorWithoutContext, {
|
|
8707
8748
|
...rest
|
|
8708
8749
|
})
|
|
8709
8750
|
})
|
|
@@ -8725,7 +8766,7 @@ function RichTextEditorWithoutContext({
|
|
|
8725
8766
|
}) {
|
|
8726
8767
|
const editable = !disabled;
|
|
8727
8768
|
const { historyState } = useSharedHistoryContext();
|
|
8728
|
-
const placeholder = /* @__PURE__ */
|
|
8769
|
+
const placeholder = /* @__PURE__ */ jsx127("div", {
|
|
8729
8770
|
className: "c-rte-placeholder",
|
|
8730
8771
|
children: placeholderText ?? ""
|
|
8731
8772
|
});
|
|
@@ -8749,39 +8790,39 @@ function RichTextEditorWithoutContext({
|
|
|
8749
8790
|
}
|
|
8750
8791
|
firstOnChangeTriggeredRef.current = true;
|
|
8751
8792
|
}
|
|
8752
|
-
return /* @__PURE__ */
|
|
8793
|
+
return /* @__PURE__ */ jsxs104(Fragment7, {
|
|
8753
8794
|
children: [
|
|
8754
|
-
/* @__PURE__ */
|
|
8795
|
+
/* @__PURE__ */ jsx127(OnChangePlugin, {
|
|
8755
8796
|
onChange: onLocalChange,
|
|
8756
8797
|
ignoreSelectionChange: true
|
|
8757
8798
|
}),
|
|
8758
|
-
/* @__PURE__ */
|
|
8799
|
+
/* @__PURE__ */ jsx127(DimensionDetectorPlugin, {
|
|
8759
8800
|
onChange: (d) => setIsSmallWidthViewport(d.isSmallWidth)
|
|
8760
8801
|
}),
|
|
8761
|
-
isSmallWidthViewport ? null : /* @__PURE__ */
|
|
8802
|
+
isSmallWidthViewport ? null : /* @__PURE__ */ jsx127(ToolbarPlugin, {
|
|
8762
8803
|
actionsMenuPrepend,
|
|
8763
8804
|
actionsMenuAppend
|
|
8764
8805
|
}),
|
|
8765
8806
|
slotPreContent,
|
|
8766
|
-
/* @__PURE__ */
|
|
8807
|
+
/* @__PURE__ */ jsxs104("div", {
|
|
8767
8808
|
className: `c-rte-editor-container ${disabled ? "disabled" : ""}`,
|
|
8768
8809
|
children: [
|
|
8769
|
-
maxLength != null ? /* @__PURE__ */
|
|
8810
|
+
maxLength != null ? /* @__PURE__ */ jsx127(MaxLengthPlugin, {
|
|
8770
8811
|
maxLength
|
|
8771
8812
|
}) : null,
|
|
8772
|
-
!autoFocus ? null : /* @__PURE__ */
|
|
8773
|
-
/* @__PURE__ */
|
|
8774
|
-
/* @__PURE__ */
|
|
8775
|
-
/* @__PURE__ */
|
|
8813
|
+
!autoFocus ? null : /* @__PURE__ */ jsx127(AutoFocusPlugin, {}),
|
|
8814
|
+
/* @__PURE__ */ jsx127(ClearEditorPlugin, {}),
|
|
8815
|
+
/* @__PURE__ */ jsx127(LexicalAutoLinkPlugin, {}),
|
|
8816
|
+
/* @__PURE__ */ jsx127(HistoryPlugin, {
|
|
8776
8817
|
externalHistoryState: historyState
|
|
8777
8818
|
}),
|
|
8778
|
-
/* @__PURE__ */
|
|
8779
|
-
contentEditable: /* @__PURE__ */
|
|
8819
|
+
/* @__PURE__ */ jsx127(RichTextPlugin, {
|
|
8820
|
+
contentEditable: /* @__PURE__ */ jsx127("div", {
|
|
8780
8821
|
className: "c-rte-editor-scroller",
|
|
8781
|
-
children: /* @__PURE__ */
|
|
8822
|
+
children: /* @__PURE__ */ jsx127("div", {
|
|
8782
8823
|
className: "c-rte-editor",
|
|
8783
8824
|
ref: onRef,
|
|
8784
|
-
children: /* @__PURE__ */
|
|
8825
|
+
children: /* @__PURE__ */ jsx127(ContentEditable, {
|
|
8785
8826
|
className: "c-rte-contenteditable-root",
|
|
8786
8827
|
id
|
|
8787
8828
|
})
|
|
@@ -8790,28 +8831,28 @@ function RichTextEditorWithoutContext({
|
|
|
8790
8831
|
placeholder,
|
|
8791
8832
|
ErrorBoundary: LexicalErrorBoundary
|
|
8792
8833
|
}),
|
|
8793
|
-
/* @__PURE__ */
|
|
8794
|
-
/* @__PURE__ */
|
|
8795
|
-
/* @__PURE__ */
|
|
8834
|
+
/* @__PURE__ */ jsx127(CodeHighlightPlugin, {}),
|
|
8835
|
+
/* @__PURE__ */ jsx127(ListPlugin, {}),
|
|
8836
|
+
/* @__PURE__ */ jsx127(ListMaxIndentLevelPlugin, {
|
|
8796
8837
|
maxDepth: 7
|
|
8797
8838
|
}),
|
|
8798
|
-
/* @__PURE__ */
|
|
8799
|
-
/* @__PURE__ */
|
|
8800
|
-
/* @__PURE__ */
|
|
8801
|
-
/* @__PURE__ */
|
|
8802
|
-
/* @__PURE__ */
|
|
8803
|
-
floatingAnchorElem && !isSmallWidthViewport && /* @__PURE__ */
|
|
8839
|
+
/* @__PURE__ */ jsx127(TablePlugin, {}),
|
|
8840
|
+
/* @__PURE__ */ jsx127(LinkPlugin, {}),
|
|
8841
|
+
/* @__PURE__ */ jsx127(HorizontalRulePlugin, {}),
|
|
8842
|
+
/* @__PURE__ */ jsx127(TabFocusPlugin, {}),
|
|
8843
|
+
/* @__PURE__ */ jsx127(TabIndentationPlugin, {}),
|
|
8844
|
+
floatingAnchorElem && !isSmallWidthViewport && /* @__PURE__ */ jsxs104(Fragment7, {
|
|
8804
8845
|
children: [
|
|
8805
|
-
/* @__PURE__ */
|
|
8846
|
+
/* @__PURE__ */ jsx127(CodeActionMenuPlugin, {
|
|
8806
8847
|
anchorElem: floatingAnchorElem
|
|
8807
8848
|
}),
|
|
8808
|
-
/* @__PURE__ */
|
|
8849
|
+
/* @__PURE__ */ jsx127(FloatingLinkEditorPlugin, {
|
|
8809
8850
|
anchorElem: floatingAnchorElem
|
|
8810
8851
|
}),
|
|
8811
|
-
/* @__PURE__ */
|
|
8852
|
+
/* @__PURE__ */ jsx127(TableActionMenuPlugin, {
|
|
8812
8853
|
anchorElem: floatingAnchorElem
|
|
8813
8854
|
}),
|
|
8814
|
-
/* @__PURE__ */
|
|
8855
|
+
/* @__PURE__ */ jsx127(FloatingTextFormatToolbarPlugin, {
|
|
8815
8856
|
anchorElem: floatingAnchorElem
|
|
8816
8857
|
})
|
|
8817
8858
|
]
|
|
@@ -8822,45 +8863,6 @@ function RichTextEditorWithoutContext({
|
|
|
8822
8863
|
});
|
|
8823
8864
|
}
|
|
8824
8865
|
|
|
8825
|
-
// src/tooltip/tooltip.tsx
|
|
8826
|
-
import * as RadixTooltip from "@radix-ui/react-tooltip";
|
|
8827
|
-
import { jsx as jsx127, jsxs as jsxs104 } from "react/jsx-runtime";
|
|
8828
|
-
function Tooltip({
|
|
8829
|
-
children,
|
|
8830
|
-
content,
|
|
8831
|
-
side,
|
|
8832
|
-
align = "center",
|
|
8833
|
-
defaultOpen = false,
|
|
8834
|
-
delayDuration = 800
|
|
8835
|
-
}) {
|
|
8836
|
-
return /* @__PURE__ */ jsx127(RadixTooltip.Provider, {
|
|
8837
|
-
delayDuration,
|
|
8838
|
-
children: /* @__PURE__ */ jsxs104(RadixTooltip.Root, {
|
|
8839
|
-
defaultOpen,
|
|
8840
|
-
children: [
|
|
8841
|
-
/* @__PURE__ */ jsx127(RadixTooltip.Trigger, {
|
|
8842
|
-
asChild: true,
|
|
8843
|
-
children
|
|
8844
|
-
}),
|
|
8845
|
-
/* @__PURE__ */ jsx127(RadixTooltip.Portal, {
|
|
8846
|
-
children: /* @__PURE__ */ jsxs104(RadixTooltip.Content, {
|
|
8847
|
-
align,
|
|
8848
|
-
className: "c-tooltip-content data-[state=delayed-open]:data-[side=top]:animate-slideDownAndFade data-[state=delayed-open]:data-[side=right]:animate-slideLeftAndFade data-[state=delayed-open]:data-[side=left]:animate-slideRightAndFade data-[state=delayed-open]:data-[side=bottom]:animate-slideUpAndFade",
|
|
8849
|
-
sideOffset: 5,
|
|
8850
|
-
side,
|
|
8851
|
-
children: [
|
|
8852
|
-
/* @__PURE__ */ jsx127(RadixTooltip.Arrow, {
|
|
8853
|
-
className: "c-tooltip-arrow"
|
|
8854
|
-
}),
|
|
8855
|
-
content
|
|
8856
|
-
]
|
|
8857
|
-
})
|
|
8858
|
-
})
|
|
8859
|
-
]
|
|
8860
|
-
})
|
|
8861
|
-
});
|
|
8862
|
-
}
|
|
8863
|
-
|
|
8864
8866
|
// src/switch/switch.tsx
|
|
8865
8867
|
import * as RadixSwitch from "@radix-ui/react-switch";
|
|
8866
8868
|
import { jsx as jsx128 } from "react/jsx-runtime";
|