@puckeditor/plugin-ai 0.8.0-canary.dc11b4e2 → 0.8.0-canary.fdb02235

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.js CHANGED
@@ -8768,6 +8768,10 @@ var inlineEditModeFor = (field) => {
8768
8768
  return type === "richtext" ? "richtext" : type === "number" ? "number" : "text";
8769
8769
  };
8770
8770
  var textFieldSelector = (field) => field.format === "json" ? `[${cssEscape2(`data-puck-field-${field.name}`)}]` : `[data-puck-field-name="${cssEscape2(field.name)}"]`;
8771
+ var isHTMLElement = (el) => {
8772
+ const HTMLElementCtor = el.ownerDocument.defaultView?.HTMLElement;
8773
+ return !!HTMLElementCtor && el instanceof HTMLElementCtor;
8774
+ };
8771
8775
  var syncFieldValues = (entry, fields, props) => {
8772
8776
  for (const field of fields) {
8773
8777
  if (field.binding !== "text") continue;
@@ -8895,6 +8899,7 @@ var wireFieldEditing = (entry, fields, wiring, opts) => {
8895
8899
  for (const field of fields) {
8896
8900
  if (field.binding !== "text") continue;
8897
8901
  queryScopedFields(entry, textFieldSelector(field)).forEach((el) => {
8902
+ if (!isHTMLElement(el)) return;
8898
8903
  if (wiring.has(el)) return;
8899
8904
  wiring.set(
8900
8905
  el,
@@ -8925,6 +8930,7 @@ var wireArrayItemEditing = ({
8925
8930
  ...Array.from(item.querySelectorAll(selector))
8926
8931
  ];
8927
8932
  for (const target of targets) {
8933
+ if (!isHTMLElement(target)) continue;
8928
8934
  if (target.closest("[data-puck-array]") !== container) continue;
8929
8935
  cleanups.push(
8930
8936
  attachInlineEditing(target, {
@@ -9595,7 +9601,7 @@ var import_jsx_runtime35 = require("react/jsx-runtime");
9595
9601
  var q2 = (0, import_qler.default)();
9596
9602
  var DEFAULT_API_VERSION = "v2";
9597
9603
  var BUILD_OP_DEBOUNCE_MS = 1e3 / 60;
9598
- var PLUGIN_AI_VERSION = true ? "0.8.0-canary.dc11b4e2" : "unknown";
9604
+ var PLUGIN_AI_VERSION = true ? "0.8.0-canary.fdb02235" : "unknown";
9599
9605
  var BENCHMARK = false;
9600
9606
  var prefixedUlid = (prefix = "") => `${prefix ? `${prefix}_` : ""}${(0, import_ulid.ulid)()}`;
9601
9607
  var getClassName18 = getClassNameFactory("Chat", styles_module_default);
package/dist/index.mjs CHANGED
@@ -8798,6 +8798,10 @@ var inlineEditModeFor = (field) => {
8798
8798
  return type === "richtext" ? "richtext" : type === "number" ? "number" : "text";
8799
8799
  };
8800
8800
  var textFieldSelector = (field) => field.format === "json" ? `[${cssEscape2(`data-puck-field-${field.name}`)}]` : `[data-puck-field-name="${cssEscape2(field.name)}"]`;
8801
+ var isHTMLElement = (el) => {
8802
+ const HTMLElementCtor = el.ownerDocument.defaultView?.HTMLElement;
8803
+ return !!HTMLElementCtor && el instanceof HTMLElementCtor;
8804
+ };
8801
8805
  var syncFieldValues = (entry, fields, props) => {
8802
8806
  for (const field of fields) {
8803
8807
  if (field.binding !== "text") continue;
@@ -8925,6 +8929,7 @@ var wireFieldEditing = (entry, fields, wiring, opts) => {
8925
8929
  for (const field of fields) {
8926
8930
  if (field.binding !== "text") continue;
8927
8931
  queryScopedFields(entry, textFieldSelector(field)).forEach((el) => {
8932
+ if (!isHTMLElement(el)) return;
8928
8933
  if (wiring.has(el)) return;
8929
8934
  wiring.set(
8930
8935
  el,
@@ -8955,6 +8960,7 @@ var wireArrayItemEditing = ({
8955
8960
  ...Array.from(item.querySelectorAll(selector))
8956
8961
  ];
8957
8962
  for (const target of targets) {
8963
+ if (!isHTMLElement(target)) continue;
8958
8964
  if (target.closest("[data-puck-array]") !== container) continue;
8959
8965
  cleanups.push(
8960
8966
  attachInlineEditing(target, {
@@ -9625,7 +9631,7 @@ import { Fragment as Fragment8, jsx as jsx35, jsxs as jsxs20 } from "react/jsx-r
9625
9631
  var q2 = qler();
9626
9632
  var DEFAULT_API_VERSION = "v2";
9627
9633
  var BUILD_OP_DEBOUNCE_MS = 1e3 / 60;
9628
- var PLUGIN_AI_VERSION = true ? "0.8.0-canary.dc11b4e2" : "unknown";
9634
+ var PLUGIN_AI_VERSION = true ? "0.8.0-canary.fdb02235" : "unknown";
9629
9635
  var BENCHMARK = false;
9630
9636
  var prefixedUlid = (prefix = "") => `${prefix ? `${prefix}_` : ""}${ulid()}`;
9631
9637
  var getClassName18 = getClassNameFactory("Chat", styles_module_default);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@puckeditor/plugin-ai",
3
- "version": "0.8.0-canary.dc11b4e2",
3
+ "version": "0.8.0-canary.fdb02235",
4
4
  "author": "Chris Villa <chris@puckeditor.com>",
5
5
  "repository": "puckeditor/puck",
6
6
  "bugs": "https://github.com/puckeditor/puck/issues",