@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.d.mts
CHANGED
|
@@ -2078,11 +2078,6 @@ type EditableTextRootProps = Omit<ComponentPropsWithoutRef<'div'>, 'defaultValue
|
|
|
2078
2078
|
* Whether the editable text is read only. If true, the editable text will not be editable and the trigger will not be shown.
|
|
2079
2079
|
*/
|
|
2080
2080
|
readOnly?: boolean;
|
|
2081
|
-
/**
|
|
2082
|
-
* When true, prevents the text from entering edit mode
|
|
2083
|
-
* @default false
|
|
2084
|
-
*/
|
|
2085
|
-
disabled?: boolean;
|
|
2086
2081
|
/**
|
|
2087
2082
|
* The id of the editable text.
|
|
2088
2083
|
*/
|
|
@@ -2119,7 +2114,6 @@ type EditableTextContextValues = {
|
|
|
2119
2114
|
typographicVariant: TypographicVariant;
|
|
2120
2115
|
submitMode: 'blur' | 'both' | 'enter' | 'none';
|
|
2121
2116
|
readOnly: boolean;
|
|
2122
|
-
disabled: boolean;
|
|
2123
2117
|
id: string;
|
|
2124
2118
|
label: string;
|
|
2125
2119
|
placeholder: string;
|
|
@@ -2128,7 +2122,7 @@ type EditableTextContextValues = {
|
|
|
2128
2122
|
finalFocusEl: (() => HTMLElement | null) | undefined;
|
|
2129
2123
|
};
|
|
2130
2124
|
declare const EditableTextContext: react.Context<EditableTextContextValues | null>;
|
|
2131
|
-
declare const EditableTextRoot: ({ children, defaultValue, value: controlledValue, onValueChange, onValueCommit, onValueRevert, onEditingChange, typographicVariant, submitMode, readOnly,
|
|
2125
|
+
declare const EditableTextRoot: ({ children, defaultValue, value: controlledValue, onValueChange, onValueCommit, onValueRevert, onEditingChange, typographicVariant, submitMode, readOnly, id, label, placeholder, minLines, maxLines, finalFocusEl, ...props }: EditableTextRootProps) => JSX$1.Element;
|
|
2132
2126
|
|
|
2133
2127
|
type EditableTextProps = Omit<EditableTextRootProps, 'children'> & {
|
|
2134
2128
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -2078,11 +2078,6 @@ type EditableTextRootProps = Omit<ComponentPropsWithoutRef<'div'>, 'defaultValue
|
|
|
2078
2078
|
* Whether the editable text is read only. If true, the editable text will not be editable and the trigger will not be shown.
|
|
2079
2079
|
*/
|
|
2080
2080
|
readOnly?: boolean;
|
|
2081
|
-
/**
|
|
2082
|
-
* When true, prevents the text from entering edit mode
|
|
2083
|
-
* @default false
|
|
2084
|
-
*/
|
|
2085
|
-
disabled?: boolean;
|
|
2086
2081
|
/**
|
|
2087
2082
|
* The id of the editable text.
|
|
2088
2083
|
*/
|
|
@@ -2119,7 +2114,6 @@ type EditableTextContextValues = {
|
|
|
2119
2114
|
typographicVariant: TypographicVariant;
|
|
2120
2115
|
submitMode: 'blur' | 'both' | 'enter' | 'none';
|
|
2121
2116
|
readOnly: boolean;
|
|
2122
|
-
disabled: boolean;
|
|
2123
2117
|
id: string;
|
|
2124
2118
|
label: string;
|
|
2125
2119
|
placeholder: string;
|
|
@@ -2128,7 +2122,7 @@ type EditableTextContextValues = {
|
|
|
2128
2122
|
finalFocusEl: (() => HTMLElement | null) | undefined;
|
|
2129
2123
|
};
|
|
2130
2124
|
declare const EditableTextContext: react.Context<EditableTextContextValues | null>;
|
|
2131
|
-
declare const EditableTextRoot: ({ children, defaultValue, value: controlledValue, onValueChange, onValueCommit, onValueRevert, onEditingChange, typographicVariant, submitMode, readOnly,
|
|
2125
|
+
declare const EditableTextRoot: ({ children, defaultValue, value: controlledValue, onValueChange, onValueCommit, onValueRevert, onEditingChange, typographicVariant, submitMode, readOnly, id, label, placeholder, minLines, maxLines, finalFocusEl, ...props }: EditableTextRootProps) => JSX$1.Element;
|
|
2132
2126
|
|
|
2133
2127
|
type EditableTextProps = Omit<EditableTextRootProps, 'children'> & {
|
|
2134
2128
|
/**
|
package/dist/index.mjs
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
|
*
|
|
@@ -14230,7 +14230,6 @@ var EditableTextRoot = ({
|
|
|
14230
14230
|
typographicVariant = "body2",
|
|
14231
14231
|
submitMode = "both",
|
|
14232
14232
|
readOnly = false,
|
|
14233
|
-
disabled = false,
|
|
14234
14233
|
id,
|
|
14235
14234
|
label,
|
|
14236
14235
|
placeholder = "Click to edit this text",
|
|
@@ -14248,14 +14247,13 @@ var EditableTextRoot = ({
|
|
|
14248
14247
|
const computedId = isNonEmptyString6(id) ? id : `wistia-ui-editable-text-${generatedId}`;
|
|
14249
14248
|
const handleSetIsEditing = useCallback16(
|
|
14250
14249
|
(editing) => {
|
|
14251
|
-
if (disabled) return;
|
|
14252
14250
|
if (editing && !isEditing) {
|
|
14253
14251
|
setOriginalValue(value);
|
|
14254
14252
|
}
|
|
14255
14253
|
setIsEditing(editing);
|
|
14256
14254
|
onEditingChange?.(editing);
|
|
14257
14255
|
},
|
|
14258
|
-
[
|
|
14256
|
+
[isEditing, value, onEditingChange]
|
|
14259
14257
|
);
|
|
14260
14258
|
const setValue = useCallback16(
|
|
14261
14259
|
(newValue) => {
|
|
@@ -14278,7 +14276,6 @@ var EditableTextRoot = ({
|
|
|
14278
14276
|
typographicVariant,
|
|
14279
14277
|
submitMode,
|
|
14280
14278
|
readOnly,
|
|
14281
|
-
disabled,
|
|
14282
14279
|
id: computedId,
|
|
14283
14280
|
label,
|
|
14284
14281
|
placeholder,
|
|
@@ -14297,7 +14294,6 @@ var EditableTextRoot = ({
|
|
|
14297
14294
|
typographicVariant,
|
|
14298
14295
|
submitMode,
|
|
14299
14296
|
readOnly,
|
|
14300
|
-
disabled,
|
|
14301
14297
|
computedId,
|
|
14302
14298
|
label,
|
|
14303
14299
|
placeholder,
|
|
@@ -14309,9 +14305,6 @@ var EditableTextRoot = ({
|
|
|
14309
14305
|
if (readOnly) {
|
|
14310
14306
|
return "read-only";
|
|
14311
14307
|
}
|
|
14312
|
-
if (disabled) {
|
|
14313
|
-
return "disabled";
|
|
14314
|
-
}
|
|
14315
14308
|
if (isEditing) {
|
|
14316
14309
|
return "editing";
|
|
14317
14310
|
}
|
|
@@ -14372,16 +14365,7 @@ var EditableTextDisplayComponent = forwardRef21(
|
|
|
14372
14365
|
if (!context) {
|
|
14373
14366
|
throw new Error("EditableTextDisplay must be used within an EditableTextRoot context");
|
|
14374
14367
|
}
|
|
14375
|
-
const {
|
|
14376
|
-
value,
|
|
14377
|
-
typographicVariant,
|
|
14378
|
-
setIsEditing,
|
|
14379
|
-
placeholder,
|
|
14380
|
-
maxLines,
|
|
14381
|
-
isEditing,
|
|
14382
|
-
minLines,
|
|
14383
|
-
disabled
|
|
14384
|
-
} = context;
|
|
14368
|
+
const { value, typographicVariant, setIsEditing, placeholder, maxLines, isEditing, minLines } = context;
|
|
14385
14369
|
const triggerButtonRef = useRef17(null);
|
|
14386
14370
|
const handleTriggerClick = () => {
|
|
14387
14371
|
setIsEditing(true);
|
|
@@ -14392,7 +14376,7 @@ var EditableTextDisplayComponent = forwardRef21(
|
|
|
14392
14376
|
if (isEditing) {
|
|
14393
14377
|
return null;
|
|
14394
14378
|
}
|
|
14395
|
-
if (asTrigger && !context.readOnly
|
|
14379
|
+
if (asTrigger && !context.readOnly) {
|
|
14396
14380
|
return /* @__PURE__ */ jsx278(ClickRegion, { targetRef: triggerButtonRef, children: /* @__PURE__ */ jsxs43(
|
|
14397
14381
|
StyledEditableTextDisplay,
|
|
14398
14382
|
{
|