@yext/visual-editor 0.0.48 → 0.0.50
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/plugin/{debugger-DoQ3QjB9-r3wNr8PH.js → debugger-DoQ3QjB9-CA94CwsZ.js} +1 -1
- package/dist/plugin/{debugger-DoQ3QjB9-BKgGx1nG.cjs → debugger-DoQ3QjB9-mGUHujXR.cjs} +1 -1
- package/dist/plugin/{index-CKR-HS0G.js → index-CXh8eLUA.js} +8 -8
- package/dist/plugin/{index-VxR-Uzc8.cjs → index-DCkjgVyf.cjs} +2 -2
- package/dist/plugin/plugin.cjs +1 -1
- package/dist/plugin/plugin.js +1 -1
- package/dist/visual-editor.cjs +3 -3
- package/dist/visual-editor.js +111 -113
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as b, n as l, e as w, a as k, l as S } from "./index-
|
|
1
|
+
import { r as b, n as l, e as w, a as k, l as S } from "./index-CXh8eLUA.js";
|
|
2
2
|
function P() {
|
|
3
3
|
return S().name !== "browser" || window.hasOwnProperty("debuggerInitialized") ? null : (window.debuggerInitialized = !0, k.createPortal(/* @__PURE__ */ l.jsx($, {}), document.body));
|
|
4
4
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index-DCkjgVyf.cjs");function N(){return n.la().name!=="browser"||window.hasOwnProperty("debuggerInitialized")?null:(window.debuggerInitialized=!0,n.reactDomExports.createPortal(n.nt.jsx(j,{}),document.body))}const k=(e,a)=>{const s=e.dataset.yaAction,t=e.dataset.yaScopeoverride,o=e.dataset.yaEventname,i=t||a;return{action:s,originalEventName:i?`${i}_${o}`:o,scope:i}},S=(e,a)=>{const s=[];let t=e;for(;t!=null&&t.parentElement;)t=t.parentElement.closest(a),t&&s.push(t);return s},v={},w="YA_NO_SCOPE",y=(e,a,s,t)=>{v.hasOwnProperty(e)?v[e].events.map(o=>o.el).includes(t)||(v[e].events=[...v[e].events,{eventData:a,el:t}]):v[e]={scopeEl:s||t,events:[{eventData:a,el:t}]}};function j(){const[e,a]=n.reactExports.useState(),[s,t]=n.reactExports.useState([]),[o,i]=n.reactExports.useState(!1),l=r=>{a(e===r?void 0:r)};return n.reactExports.useEffect(()=>{let r=null;const d=()=>{r&&r.abort(),r=new AbortController;const c=r.signal;document.documentElement.classList.add("xYextDebug"),document.querySelectorAll("[data-ya-eventname]").forEach((u,E)=>{const m=u.closest("[data-ya-scope]"),h=m?.dataset.yaScope,p=k(u,h);u.addEventListener("mouseenter",()=>{t([{elem:u,key:`${p.originalEventName}_${E}`,action:p.action,originalEventName:p.originalEventName,scope:p.scope}])},{signal:c}),u.addEventListener("mouseleave",()=>{t([])},{signal:c});const x=u.dataset.yaScopeoverride;x?y(x,p,m,u):[h,...S(u,"[data-ya-scope]").map(b=>b.dataset.yaScope)].forEach(b=>{y(b||w,p,m,u)})}),i(!0)};d();const g=new MutationObserver(d);return g.observe(document,{childList:!0,subtree:!0}),()=>{document.documentElement.classList.remove("xYextDebug"),g.disconnect(),r?.abort()}},[]),o?n.nt.jsxs(n.nt.Fragment,{children:[n.nt.jsxs("div",{className:"analytics-debugger",children:[n.nt.jsxs("div",{className:"analytics-debugger-toggles",children:[n.nt.jsx("button",{className:n.el("analytics-debugger-toggle",{"is-active":e==="Events"}),onClick:()=>l("Events"),children:"Events"}),n.nt.jsx("button",{className:n.el("analytics-debugger-toggle",{"is-active":e==="Scopes"}),onClick:()=>l("Scopes"),children:"Scopes"})]}),e&&n.nt.jsx("div",{className:"analytics-debugger-tabs",children:e==="Events"?n.nt.jsx(C,{data:v,setTooltips:t}):n.nt.jsx($,{data:v,setTooltips:t})})]}),n.nt.jsx(D,{tooltips:s})]}):null}const Y=()=>{const e={};return Object.values(v).forEach(a=>{a.events.forEach(s=>{const{originalEventName:t}=s.eventData;e[t]||(e[t]=[]),!e[t].find(o=>o.el===s.el)&&e[t].push(s)})}),e};function C(e){const{setTooltips:a}=e,[s,t]=n.reactExports.useState([]),[o,i]=n.reactExports.useState(""),l=(r,d)=>{s.forEach(c=>c.classList.remove("analytics-event-highlight"));const g=r.map(c=>(c.el.scrollIntoView({behavior:"smooth",block:"nearest"}),c.el.classList.add("analytics-event-highlight"),c.el));t(g),i(d),a(r.map((c,u)=>({elem:c.el,key:`${c.eventData.originalEventName}_${u}`,action:c.eventData.action,originalEventName:c.eventData.originalEventName,scope:c.eventData.scope})))};return n.nt.jsxs("div",{className:"analytics-debugger-tab",children:[n.nt.jsx("h2",{className:"analytics-debugger-tab-title",children:"Event Names"}),n.nt.jsx("ul",{className:"analytics-debugger-list",children:Object.entries(Y()).map(([r,d],g)=>{const c=`${r}_${g}`;return n.nt.jsx("li",{className:"analytics-debugger-listItem",children:n.nt.jsx("button",{className:n.el("analytics-debugger-button",{"is-active":c===o}),onClick:()=>l(d,c),children:r})},c)})})]})}function $(e){const{data:a,setTooltips:s}=e,[t,o]=n.reactExports.useState(""),i=l=>{const r=a[l];r.scopeEl&&(r.scopeEl.scrollIntoView({behavior:"smooth",block:"nearest"}),o(l),s(r.events.map((d,g)=>{const c=d.eventData;return{elem:d.el,key:`${c.originalEventName}_${g}`,action:c.action,originalEventName:c.originalEventName,scope:c.scope}})))};return n.nt.jsxs("div",{className:"analytics-debugger-tab",children:[n.nt.jsx("h2",{className:"analytics-debugger-tab-title",children:"Scope Names"}),n.nt.jsx("ul",{className:"analytics-debugger-list",children:Object.keys(a).map((l,r)=>{if(l!==w)return n.nt.jsx("li",{className:"analytics-debugger-listItem",children:n.nt.jsx("button",{className:n.el("analytics-debugger-button",{"is-active":l===t}),onClick:()=>i(l),children:l})},l+r)})})]})}function D(e){const a=n.reactExports.useRef({});return n.reactExports.useEffect(()=>{if(a.current)for(const s of Object.values(a.current)){const t=Object.values(a.current).map(o=>o.el).filter(o=>o!==s.el);O(s,t),s.el.style.visibility="visible"}},[e.tooltips]),n.nt.jsx(n.nt.Fragment,{children:e.tooltips.map(s=>n.nt.jsxs("div",{style:{visibility:"hidden"},className:"analytics-debugger-tooltip",ref:t=>{t?a.current[s.key]={el:t,tooltip:s}:delete a.current[s.key]},children:[n.nt.jsxs("span",{children:["Action: ",s.action]}),n.nt.jsx("br",{}),n.nt.jsxs("span",{children:["Scope: ",s.scope]}),n.nt.jsx("br",{}),n.nt.jsxs("span",{children:["Original Event Name: ",s.originalEventName]})]},s.key))})}function O(e,a){for(let s=0;s<9;s++){const t=I(e.tooltip.elem.getBoundingClientRect(),e.el,s);if(e.el.style.inset=`${t.top} auto auto ${t.left}`,!!B(e.el.getBoundingClientRect().left,e.el.getBoundingClientRect().top+window.scrollY,e.el.getBoundingClientRect().right,e.el.getBoundingClientRect().bottom+window.scrollY))continue;let o=!0;for(let i=0;i<a.length;i++){const l=a[i];R(e.el,l)&&(o=!1)}if(o)break}}function R(e,a){const s=e.getBoundingClientRect().top+window.scrollY,t=e.getBoundingClientRect().left,o=s+e.clientHeight,i=t+e.clientWidth,l=a.getBoundingClientRect().top+window.scrollY,r=a.getBoundingClientRect().left,d=l+a.clientHeight,g=r+a.clientWidth,c=(u,E,m,h,p,x,b,f)=>m<=p&&p<=b&&h<=x&&x<=f||m<=u&&u<=b&&h<=E&&E<=f||m<=u&&u<=b&&h<=x&&x<=f||m<=p&&p<=b&&h<=E&&E<=f;return c(t,s,r,l,i,o,g,d)||c(r,l,t,s,g,d,i,o)}function B(e,a,s,t){return e<0||s>window.innerWidth||a<0||t>document.documentElement.scrollHeight}function I(e,a,s){const t=a.clientHeight,o=a.clientWidth;let i,l;switch(s){case 0:{l=window.scrollY+e.top-t+"px",i=e.left-o+"px";break}case 1:{l=window.scrollY+e.top-t+"px",i=e.left+"px";break}case 2:{l=window.scrollY+e.top-t+"px",i=e.right+"px";break}case 3:{l=window.scrollY+e.top-t+"px",i=e.right-o+"px";break}case 4:{l=window.scrollY+e.bottom+"px",i=e.left-o+"px";break}case 5:{l=window.scrollY+e.bottom+"px",i=e.left+"px";break}case 6:{l=window.scrollY+e.bottom+"px",i=e.right-o+"px";break}case 7:{l=window.scrollY+e.bottom+"px",i=e.right+"px";break}default:l=0,i=0}return{top:l,left:i}}exports.AnalyticsDebuggerInternal=j;exports.default=N;
|
|
@@ -22186,7 +22186,7 @@ let nXe = class {
|
|
|
22186
22186
|
}
|
|
22187
22187
|
};
|
|
22188
22188
|
const rXe = () => new nXe(), iXe = xe.createContext(null);
|
|
22189
|
-
xe.lazy(() => import("./debugger-DoQ3QjB9-
|
|
22189
|
+
xe.lazy(() => import("./debugger-DoQ3QjB9-CA94CwsZ.js"));
|
|
22190
22190
|
const aXe = xe.createContext({ name: "" }), oXe = () => xe.useContext(aXe).name;
|
|
22191
22191
|
function sXe() {
|
|
22192
22192
|
const e = xe.useContext(iXe);
|
|
@@ -117472,7 +117472,7 @@ const Bbt = NHe(FVe), MHe = {
|
|
|
117472
117472
|
}
|
|
117473
117473
|
) })
|
|
117474
117474
|
}, Gbt = () => {
|
|
117475
|
-
const { t: e, i18n: t } = Fv(),
|
|
117475
|
+
const { t: e, i18n: t } = Fv(), n = Gu(), r = xe.useMemo(() => ou(
|
|
117476
117476
|
Ze("title", "Title"),
|
|
117477
117477
|
{ types: ["type.string"] }
|
|
117478
117478
|
), []), o = xe.useMemo(() => Dw(
|
|
@@ -117548,7 +117548,7 @@ const Bbt = NHe(FVe), MHe = {
|
|
|
117548
117548
|
}
|
|
117549
117549
|
) })
|
|
117550
117550
|
}, Ybt = () => {
|
|
117551
|
-
const { t: e, i18n: t } = Fv(),
|
|
117551
|
+
const { t: e, i18n: t } = Fv(), n = Gu(), r = xe.useMemo(() => ou(
|
|
117552
117552
|
Ze("name", "Name"),
|
|
117553
117553
|
{ types: ["type.string"] }
|
|
117554
117554
|
), []), o = xe.useMemo(() => ou(
|
|
@@ -117618,7 +117618,7 @@ const Bbt = NHe(FVe), MHe = {
|
|
|
117618
117618
|
}
|
|
117619
117619
|
) })
|
|
117620
117620
|
}, Jbt = () => {
|
|
117621
|
-
const { t: e, i18n: t } = Fv(),
|
|
117621
|
+
const { t: e, i18n: t } = Fv(), n = Gu(), r = xe.useMemo(() => ou(
|
|
117622
117622
|
Ze("fields.name", "Name"),
|
|
117623
117623
|
{ types: ["type.string"] }
|
|
117624
117624
|
), []), o = xe.useMemo(() => ou(
|
|
@@ -117676,7 +117676,7 @@ const Bbt = NHe(FVe), MHe = {
|
|
|
117676
117676
|
}
|
|
117677
117677
|
) })
|
|
117678
117678
|
}, t_t = () => {
|
|
117679
|
-
const { t: e, i18n: t } = Fv(),
|
|
117679
|
+
const { t: e, i18n: t } = Fv(), n = Gu(), r = xe.useMemo(() => ou(Ze("fields.question", "Question"), {
|
|
117680
117680
|
types: ["type.string"]
|
|
117681
117681
|
}), []), o = xe.useMemo(() => Dw(Ze("fields.answer", "Answer")), []);
|
|
117682
117682
|
return {
|
|
@@ -117722,7 +117722,7 @@ const Bbt = NHe(FVe), MHe = {
|
|
|
117722
117722
|
}
|
|
117723
117723
|
) })
|
|
117724
117724
|
}, i_t = () => {
|
|
117725
|
-
const { t: e, i18n: t } = Fv(),
|
|
117725
|
+
const { t: e, i18n: t } = Fv(), n = Gu(), r = xe.useMemo(() => ou(
|
|
117726
117726
|
Ze("fields.name", "Name"),
|
|
117727
117727
|
{ types: ["type.string"] }
|
|
117728
117728
|
), []), o = xe.useMemo(() => ou(
|
|
@@ -117780,7 +117780,7 @@ const Bbt = NHe(FVe), MHe = {
|
|
|
117780
117780
|
}
|
|
117781
117781
|
) })
|
|
117782
117782
|
}, s_t = () => {
|
|
117783
|
-
const { t: e, i18n: t } = Fv(),
|
|
117783
|
+
const { t: e, i18n: t } = Fv(), n = Gu(), r = xe.useMemo(() => ou(
|
|
117784
117784
|
Ze("fields.contributorName", "Contributor Name"),
|
|
117785
117785
|
{ types: ["type.string"] }
|
|
117786
117786
|
), []), o = xe.useMemo(() => Dw(
|
|
@@ -118109,7 +118109,7 @@ const Bbt = NHe(FVe), MHe = {
|
|
|
118109
118109
|
), { i18n: a } = Hd(), v = a.language;
|
|
118110
118110
|
if (!h)
|
|
118111
118111
|
return;
|
|
118112
|
-
const k = (o = e.types) != null && o.includes("type.string") ? /* @__PURE__ */ Ye.jsx("div", { className: "ve-pt-3", children: /* @__PURE__ */ Ye.jsx(
|
|
118112
|
+
const k = (o = e.types) != null && o.includes("type.string") && !e.includeListsOnly ? /* @__PURE__ */ Ye.jsx("div", { className: "ve-pt-3", children: /* @__PURE__ */ Ye.jsx(
|
|
118113
118113
|
$Ve,
|
|
118114
118114
|
{
|
|
118115
118115
|
value: ((f = n?.constantValue) == null ? void 0 : f[v]) ?? "",
|