@wistia/ui 0.18.0-beta.6d32b1a6.7a80f3d → 0.18.0-beta.80cfc750.f949e60
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/index.cjs +4 -20
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +1 -7
- package/dist/index.d.ts +1 -7
- package/dist/index.mjs +4 -20
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v0.18.0-beta.
|
|
3
|
+
* @license @wistia/ui v0.18.0-beta.80cfc750.f949e60
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -14380,7 +14380,6 @@ var EditableTextRoot = ({
|
|
|
14380
14380
|
typographicVariant = "body2",
|
|
14381
14381
|
submitMode = "both",
|
|
14382
14382
|
readOnly = false,
|
|
14383
|
-
disabled = false,
|
|
14384
14383
|
id,
|
|
14385
14384
|
label,
|
|
14386
14385
|
placeholder = "Click to edit this text",
|
|
@@ -14398,14 +14397,13 @@ var EditableTextRoot = ({
|
|
|
14398
14397
|
const computedId = (0, import_type_guards45.isNonEmptyString)(id) ? id : `wistia-ui-editable-text-${generatedId}`;
|
|
14399
14398
|
const handleSetIsEditing = (0, import_react64.useCallback)(
|
|
14400
14399
|
(editing) => {
|
|
14401
|
-
if (disabled) return;
|
|
14402
14400
|
if (editing && !isEditing) {
|
|
14403
14401
|
setOriginalValue(value);
|
|
14404
14402
|
}
|
|
14405
14403
|
setIsEditing(editing);
|
|
14406
14404
|
onEditingChange?.(editing);
|
|
14407
14405
|
},
|
|
14408
|
-
[
|
|
14406
|
+
[isEditing, value, onEditingChange]
|
|
14409
14407
|
);
|
|
14410
14408
|
const setValue = (0, import_react64.useCallback)(
|
|
14411
14409
|
(newValue) => {
|
|
@@ -14428,7 +14426,6 @@ var EditableTextRoot = ({
|
|
|
14428
14426
|
typographicVariant,
|
|
14429
14427
|
submitMode,
|
|
14430
14428
|
readOnly,
|
|
14431
|
-
disabled,
|
|
14432
14429
|
id: computedId,
|
|
14433
14430
|
label,
|
|
14434
14431
|
placeholder,
|
|
@@ -14447,7 +14444,6 @@ var EditableTextRoot = ({
|
|
|
14447
14444
|
typographicVariant,
|
|
14448
14445
|
submitMode,
|
|
14449
14446
|
readOnly,
|
|
14450
|
-
disabled,
|
|
14451
14447
|
computedId,
|
|
14452
14448
|
label,
|
|
14453
14449
|
placeholder,
|
|
@@ -14459,9 +14455,6 @@ var EditableTextRoot = ({
|
|
|
14459
14455
|
if (readOnly) {
|
|
14460
14456
|
return "read-only";
|
|
14461
14457
|
}
|
|
14462
|
-
if (disabled) {
|
|
14463
|
-
return "disabled";
|
|
14464
|
-
}
|
|
14465
14458
|
if (isEditing) {
|
|
14466
14459
|
return "editing";
|
|
14467
14460
|
}
|
|
@@ -14522,16 +14515,7 @@ var EditableTextDisplayComponent = (0, import_react65.forwardRef)(
|
|
|
14522
14515
|
if (!context) {
|
|
14523
14516
|
throw new Error("EditableTextDisplay must be used within an EditableTextRoot context");
|
|
14524
14517
|
}
|
|
14525
|
-
const {
|
|
14526
|
-
value,
|
|
14527
|
-
typographicVariant,
|
|
14528
|
-
setIsEditing,
|
|
14529
|
-
placeholder,
|
|
14530
|
-
maxLines,
|
|
14531
|
-
isEditing,
|
|
14532
|
-
minLines,
|
|
14533
|
-
disabled
|
|
14534
|
-
} = context;
|
|
14518
|
+
const { value, typographicVariant, setIsEditing, placeholder, maxLines, isEditing, minLines } = context;
|
|
14535
14519
|
const triggerButtonRef = (0, import_react65.useRef)(null);
|
|
14536
14520
|
const handleTriggerClick = () => {
|
|
14537
14521
|
setIsEditing(true);
|
|
@@ -14542,7 +14526,7 @@ var EditableTextDisplayComponent = (0, import_react65.forwardRef)(
|
|
|
14542
14526
|
if (isEditing) {
|
|
14543
14527
|
return null;
|
|
14544
14528
|
}
|
|
14545
|
-
if (asTrigger && !context.readOnly
|
|
14529
|
+
if (asTrigger && !context.readOnly) {
|
|
14546
14530
|
return /* @__PURE__ */ (0, import_jsx_runtime278.jsx)(ClickRegion, { targetRef: triggerButtonRef, children: /* @__PURE__ */ (0, import_jsx_runtime278.jsxs)(
|
|
14547
14531
|
StyledEditableTextDisplay,
|
|
14548
14532
|
{
|