@wistia/vhs 4.0.0-beta.144ba507.317e0d6 → 4.0.0-beta.297d7ed5.4ab52c0
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 +19 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +32 -30
- package/dist/index.d.ts +32 -30
- package/dist/index.mjs +31 -23
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -4
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/vhs v4.0.0-beta.
|
|
3
|
+
* @license @wistia/vhs v4.0.0-beta.297d7ed5.4ab52c0
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2021-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -8065,7 +8065,7 @@ FormConnectorCheckboxGroup.displayName = "FormConnectorCheckboxGroup";
|
|
|
8065
8065
|
var import_type_guards33 = require("@wistia/type-guards");
|
|
8066
8066
|
var import_jsx_runtime158 = require("react/jsx-runtime");
|
|
8067
8067
|
var FormConnectorCustomField = ({
|
|
8068
|
-
customComponent:
|
|
8068
|
+
customComponent: Element8,
|
|
8069
8069
|
field,
|
|
8070
8070
|
form,
|
|
8071
8071
|
label = "",
|
|
@@ -8084,7 +8084,7 @@ var FormConnectorCustomField = ({
|
|
|
8084
8084
|
labelProps,
|
|
8085
8085
|
name,
|
|
8086
8086
|
children: /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
|
|
8087
|
-
|
|
8087
|
+
Element8,
|
|
8088
8088
|
{
|
|
8089
8089
|
field,
|
|
8090
8090
|
form,
|
|
@@ -9056,7 +9056,7 @@ var import_styled_components50 = require("styled-components");
|
|
|
9056
9056
|
var import_slate_react3 = require("slate-react");
|
|
9057
9057
|
var import_slate7 = require("slate");
|
|
9058
9058
|
var import_slate_history = require("slate-history");
|
|
9059
|
-
var import_is_hotkey =
|
|
9059
|
+
var import_is_hotkey = require("is-hotkey");
|
|
9060
9060
|
var import_type_guards50 = require("@wistia/type-guards");
|
|
9061
9061
|
var import_react_fast_compare2 = __toESM(require("react-fast-compare"));
|
|
9062
9062
|
|
|
@@ -9305,7 +9305,10 @@ var deserializeHTMLNode = (el) => {
|
|
|
9305
9305
|
return null;
|
|
9306
9306
|
}
|
|
9307
9307
|
const children = getNodeChildren(el, deserializeHTMLNode);
|
|
9308
|
-
const
|
|
9308
|
+
const filteredChildren = children.filter(
|
|
9309
|
+
(child) => child === null || typeof child === "string" || typeof child === "object" && ("text" in child || "type" in child)
|
|
9310
|
+
);
|
|
9311
|
+
const safeChildren = filteredChildren.length > 0 && filteredChildren[0] != null ? filteredChildren : [emptyTextNode];
|
|
9309
9312
|
if (el.nodeName === "BODY") {
|
|
9310
9313
|
return (0, import_slate_hyperscript.jsx)("fragment", {}, safeChildren);
|
|
9311
9314
|
}
|
|
@@ -9619,7 +9622,8 @@ var wrapLink = (editor, url) => {
|
|
|
9619
9622
|
}
|
|
9620
9623
|
};
|
|
9621
9624
|
var withLinks = (editor) => {
|
|
9622
|
-
const {
|
|
9625
|
+
const { insertText, isInline, normalizeNode } = editor;
|
|
9626
|
+
const { insertData } = editor;
|
|
9623
9627
|
editor.isInline = (element) => element.type === "link" ? true : isInline(element);
|
|
9624
9628
|
editor.insertText = (text) => {
|
|
9625
9629
|
if (text && isUrl(text)) {
|
|
@@ -9701,7 +9705,7 @@ var handleListEscape = (editor) => {
|
|
|
9701
9705
|
const selectedElement = editor.children[selection.anchor.path[0]];
|
|
9702
9706
|
const isList = selectedElement.type === "bulleted-list" || selectedElement.type === "numbered-list";
|
|
9703
9707
|
const blockAbove = OverriddenEditor.above(editor, {
|
|
9704
|
-
match: (node) => OverriddenEditor.isBlck(editor, node)
|
|
9708
|
+
match: (node) => import_slate5.Element.isElement(node) && OverriddenEditor.isBlck(editor, node)
|
|
9705
9709
|
});
|
|
9706
9710
|
if ((textIsNotSelected ?? false) && isList && isLastChildBlankText(blockAbove[0].children)) {
|
|
9707
9711
|
import_slate5.Transforms.removeNodes(editor, { hanging: true });
|
|
@@ -10193,13 +10197,15 @@ var RichTextEditor = ({
|
|
|
10193
10197
|
toggleBlck(editor, "image");
|
|
10194
10198
|
import_slate7.Transforms.removeNodes(editor, { at: selection });
|
|
10195
10199
|
import_slate7.Transforms.move(editor, { reverse: true });
|
|
10196
|
-
const spanElement = editor.children.filter(
|
|
10200
|
+
const spanElement = editor.children.filter(
|
|
10201
|
+
(child) => import_slate7.Element.isElement(child) && child.type === "span"
|
|
10202
|
+
)[0];
|
|
10197
10203
|
if (import_slate7.Element.isElement(spanElement) && spanElement.type === "span" && (0, import_type_guards50.isNotNil)(spanElement.children) && (0, import_type_guards50.isNotNil)(spanElement.children[0]) && (0, import_type_guards50.isNotNil)(spanElement.children[0].text) && spanElement.children[0].text.trim() !== "") {
|
|
10198
10204
|
import_slate7.Transforms.setNodes(
|
|
10199
10205
|
editor,
|
|
10200
10206
|
{ type: "paragraph" },
|
|
10201
10207
|
{
|
|
10202
|
-
match: (node) => node.type === "span" && (0, import_type_guards50.isNotNil)(node.children) && import_slate7.Text.isText(node.children[0]) && (0, import_type_guards50.isNotNil)(node.children[0].text) && node.children[0].text.trim() !== "",
|
|
10208
|
+
match: (node) => import_slate7.Element.isElement(node) && node.type === "span" && (0, import_type_guards50.isNotNil)(node.children) && import_slate7.Text.isText(node.children[0]) && (0, import_type_guards50.isNotNil)(node.children[0].text) && node.children[0].text.trim() !== "",
|
|
10203
10209
|
split: true,
|
|
10204
10210
|
mode: "highest"
|
|
10205
10211
|
}
|
|
@@ -10215,7 +10221,9 @@ var RichTextEditor = ({
|
|
|
10215
10221
|
"data-testid": dataTestId,
|
|
10216
10222
|
disabled,
|
|
10217
10223
|
height,
|
|
10218
|
-
onClick: () =>
|
|
10224
|
+
onClick: () => {
|
|
10225
|
+
import_slate_react3.ReactEditor.focus(editor);
|
|
10226
|
+
},
|
|
10219
10227
|
children: /* @__PURE__ */ (0, import_jsx_runtime183.jsxs)(
|
|
10220
10228
|
import_slate_react3.Slate,
|
|
10221
10229
|
{
|
|
@@ -10240,7 +10248,7 @@ var RichTextEditor = ({
|
|
|
10240
10248
|
onBlur: handleEditorBlur,
|
|
10241
10249
|
onKeyDown: (event) => {
|
|
10242
10250
|
Object.keys(HOTKEYS).forEach((hotKey) => {
|
|
10243
|
-
if ((0, import_is_hotkey.
|
|
10251
|
+
if ((0, import_is_hotkey.isHotkey)(hotKey, event)) {
|
|
10244
10252
|
event.preventDefault();
|
|
10245
10253
|
toggleMark(editor, HOTKEYS[hotKey]);
|
|
10246
10254
|
}
|