@wistia/vhs 4.0.0-beta.c3470991.bde9434 → 4.0.0-beta.cfb66734.5d7766b

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 CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  /*
3
- * @license @wistia/vhs v4.0.0-beta.c3470991.bde9434
3
+ * @license @wistia/vhs v4.0.0-beta.cfb66734.5d7766b
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: Element7,
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
- Element7,
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 = __toESM(require("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 safeChildren = children.length > 0 && children[0] != null ? children : [emptyTextNode];
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
  }
@@ -9701,7 +9704,7 @@ var handleListEscape = (editor) => {
9701
9704
  const selectedElement = editor.children[selection.anchor.path[0]];
9702
9705
  const isList = selectedElement.type === "bulleted-list" || selectedElement.type === "numbered-list";
9703
9706
  const blockAbove = OverriddenEditor.above(editor, {
9704
- match: (node) => OverriddenEditor.isBlck(editor, node)
9707
+ match: (node) => import_slate5.Element.isElement(node) && OverriddenEditor.isBlck(editor, node)
9705
9708
  });
9706
9709
  if ((textIsNotSelected ?? false) && isList && isLastChildBlankText(blockAbove[0].children)) {
9707
9710
  import_slate5.Transforms.removeNodes(editor, { hanging: true });
@@ -10193,13 +10196,15 @@ var RichTextEditor = ({
10193
10196
  toggleBlck(editor, "image");
10194
10197
  import_slate7.Transforms.removeNodes(editor, { at: selection });
10195
10198
  import_slate7.Transforms.move(editor, { reverse: true });
10196
- const spanElement = editor.children.filter((child) => child.type === "span")[0];
10199
+ const spanElement = editor.children.filter(
10200
+ (child) => import_slate7.Element.isElement(child) && child.type === "span"
10201
+ )[0];
10197
10202
  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
10203
  import_slate7.Transforms.setNodes(
10199
10204
  editor,
10200
10205
  { type: "paragraph" },
10201
10206
  {
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() !== "",
10207
+ 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
10208
  split: true,
10204
10209
  mode: "highest"
10205
10210
  }
@@ -10215,7 +10220,9 @@ var RichTextEditor = ({
10215
10220
  "data-testid": dataTestId,
10216
10221
  disabled,
10217
10222
  height,
10218
- onClick: () => import_slate_react3.ReactEditor.focus(editor),
10223
+ onClick: () => {
10224
+ import_slate_react3.ReactEditor.focus(editor);
10225
+ },
10219
10226
  children: /* @__PURE__ */ (0, import_jsx_runtime183.jsxs)(
10220
10227
  import_slate_react3.Slate,
10221
10228
  {
@@ -10240,7 +10247,7 @@ var RichTextEditor = ({
10240
10247
  onBlur: handleEditorBlur,
10241
10248
  onKeyDown: (event) => {
10242
10249
  Object.keys(HOTKEYS).forEach((hotKey) => {
10243
- if ((0, import_is_hotkey.default)(hotKey, event)) {
10250
+ if ((0, import_is_hotkey.isHotkey)(hotKey, event)) {
10244
10251
  event.preventDefault();
10245
10252
  toggleMark(editor, HOTKEYS[hotKey]);
10246
10253
  }