@yext/visual-editor 0.0.43 → 0.0.45
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.d.cts +224 -59
- package/dist/index.d.ts +224 -59
- package/dist/plugin/{debugger-rlNxnZtt-0yDbAQLD.js → debugger-BwrGCC7Q-B7S-mlGb.js} +122 -101
- package/dist/plugin/debugger-BwrGCC7Q-DdB4cbWi.cjs +1 -0
- package/dist/plugin/{index-Cs0QW4io.js → index-BAnL5AMG.js} +45333 -41993
- package/dist/plugin/index-DvewYwma.cjs +2621 -0
- package/dist/plugin/plugin.cjs +1 -1
- package/dist/plugin/plugin.js +1 -1
- package/dist/style.css +1 -1
- package/dist/visual-editor.cjs +81 -86
- package/dist/visual-editor.js +23093 -18864
- package/package.json +7 -14
- package/dist/plugin/debugger-rlNxnZtt-DlXl4uaY.cjs +0 -1
- package/dist/plugin/index-BspHgnfK.cjs +0 -2626
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yext/visual-editor",
|
|
3
3
|
"description": "Component library for Yext Pages Visual Editor",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.45",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "sumo@yext.com",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"test:editor": "vitest run --exclude './src/components/**/*.test.tsx' --browser.enabled false",
|
|
36
36
|
"test:components": "vitest run ./src/components/**",
|
|
37
37
|
"prettier": "prettier --write --cache .",
|
|
38
|
-
"lint": "
|
|
38
|
+
"lint": "oxlint --fix --ignore-pattern 'src/vite-plugin/templates/*'",
|
|
39
39
|
"autofix": "pnpm run lint && pnpm run prettier",
|
|
40
40
|
"prepare": "pnpm build",
|
|
41
41
|
"generate-notices": "generate-license-file --input package.json --output ./THIRD-PARTY-NOTICES --overwrite",
|
|
@@ -66,14 +66,13 @@
|
|
|
66
66
|
"@radix-ui/react-separator": "^1.1.7",
|
|
67
67
|
"@radix-ui/react-slot": "^1.1.0",
|
|
68
68
|
"@radix-ui/react-switch": "^1.1.0",
|
|
69
|
+
"@radix-ui/react-toggle": "^1.1.9",
|
|
69
70
|
"@radix-ui/react-tooltip": "^1.1.2",
|
|
70
71
|
"@tanstack/react-query": "^5.71.5",
|
|
71
72
|
"class-variance-authority": "^0.7.0",
|
|
72
73
|
"clsx": "^2.1.1",
|
|
73
74
|
"cmdk": "^1.1.1",
|
|
74
75
|
"dompurify": "^3.2.3",
|
|
75
|
-
"eslint": "^9.8.0",
|
|
76
|
-
"eslint-plugin-react": "^7.35.0",
|
|
77
76
|
"i18next": "^25.2.1",
|
|
78
77
|
"lucide-react": "^0.414.0",
|
|
79
78
|
"lz-string": "1.5.0",
|
|
@@ -95,12 +94,9 @@
|
|
|
95
94
|
"packageManager": "pnpm@9.12.3",
|
|
96
95
|
"lint-staged": {
|
|
97
96
|
"*": "prettier --write --cache --ignore-unknown",
|
|
98
|
-
"*.{ts,js,tsx,jsx}": "
|
|
97
|
+
"*.{ts,js,tsx,jsx}": "oxlint --fix --ignore-pattern 'src/vite-plugin/templates/*'"
|
|
99
98
|
},
|
|
100
99
|
"devDependencies": {
|
|
101
|
-
"@eslint/compat": "^1.1.1",
|
|
102
|
-
"@eslint/eslintrc": "^3.1.0",
|
|
103
|
-
"@eslint/js": "^9.8.0",
|
|
104
100
|
"@testing-library/dom": "^10.4.0",
|
|
105
101
|
"@testing-library/react": "^16.3.0",
|
|
106
102
|
"@types/fs-extra": "^11.0.4",
|
|
@@ -114,13 +110,10 @@
|
|
|
114
110
|
"@types/react-dom": "^18.3.0",
|
|
115
111
|
"@types/semver": "^7.5.8",
|
|
116
112
|
"@types/uuid": "^10.0.0",
|
|
117
|
-
"@typescript-eslint/eslint-plugin": "^8.0.1",
|
|
118
|
-
"@typescript-eslint/parser": "^8.0.1",
|
|
119
113
|
"@vitejs/plugin-react": "^4.3.1",
|
|
120
114
|
"@vitest/browser": "^3.1.1",
|
|
121
115
|
"autoprefixer": "^10.4.2",
|
|
122
116
|
"axe-core": "^4.10.3",
|
|
123
|
-
"eslint-plugin-import": "^2.29.1",
|
|
124
117
|
"execa": "^8.0.1",
|
|
125
118
|
"fs-extra": "^11.2.0",
|
|
126
119
|
"generate-license-file": "^3.5.0",
|
|
@@ -148,9 +141,9 @@
|
|
|
148
141
|
"zod": "^3.23.8"
|
|
149
142
|
},
|
|
150
143
|
"peerDependencies": {
|
|
151
|
-
"@yext/pages-components": "^1.1.
|
|
152
|
-
"@yext/search-headless-react": "^2.5.
|
|
153
|
-
"@yext/search-ui-react": "^1.
|
|
144
|
+
"@yext/pages-components": "^1.1.9",
|
|
145
|
+
"@yext/search-headless-react": "^2.5.3",
|
|
146
|
+
"@yext/search-ui-react": "^1.9.0",
|
|
154
147
|
"mapbox-gl": "^2.9.2",
|
|
155
148
|
"react": "^17.0.2 || ^18.2.0",
|
|
156
149
|
"react-dom": "^17.0.2 || ^18.2.0"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index-BspHgnfK.cjs");function N(){return n.sa().name!=="browser"||window.hasOwnProperty("debuggerInitialized")?null:(window.debuggerInitialized=!0,n.reactDomExports.createPortal(n.ft.jsx(w,{}),document.body))}const k=(t,a)=>{const s=t.dataset.yaAction,e=t.dataset.yaScopeoverride,i=t.dataset.yaEventname,c=e||a;return{action:s,originalEventName:c?`${c}_${i}`:i,scope:c}},S=(t,a)=>{const s=[];let e=t;for(;e!=null&&e.parentElement;)e=e.parentElement.closest(a),e&&s.push(e);return s},m={},j="YA_NO_SCOPE",y=(t,a,s,e)=>{m.hasOwnProperty(t)?m[t].events.map(i=>i.el).includes(e)||(m[t].events=[...m[t].events,{eventData:a,el:e}]):m[t]={scopeEl:s||e,events:[{eventData:a,el:e}]}};function w(){const[t,a]=n.reactExports.useState(),[s,e]=n.reactExports.useState([]),[i,c]=n.reactExports.useState(!1),l=o=>{a(t===o?void 0:o)};return n.reactExports.useEffect(()=>(document.documentElement.classList.add("xYextDebug"),document.querySelectorAll("[data-ya-eventname]").forEach((o,g)=>{const d=o.closest("[data-ya-scope]"),r=d?.dataset.yaScope,u=k(o,r);o.addEventListener("mouseenter",()=>{e([{elem:o,key:`${u.originalEventName}_${g}`,action:u.action,originalEventName:u.originalEventName,scope:u.scope}])}),o.addEventListener("mouseleave",()=>{e([])});const f=o.dataset.yaScopeoverride;f?y(f,u,d,o):[r,...S(o,"[data-ya-scope]").map(p=>p.dataset.yaScope)].forEach(p=>{y(p||j,u,d,o)})}),c(!0),()=>{document.documentElement.classList.remove("xYextDebug")}),[]),i?n.ft.jsxs(n.ft.Fragment,{children:[n.ft.jsxs("div",{className:"analytics-debugger",children:[n.ft.jsxs("div",{className:"analytics-debugger-toggles",children:[n.ft.jsx("button",{className:n.oa("analytics-debugger-toggle",{"is-active":t==="Events"}),onClick:()=>l("Events"),children:"Events"}),n.ft.jsx("button",{className:n.oa("analytics-debugger-toggle",{"is-active":t==="Scopes"}),onClick:()=>l("Scopes"),children:"Scopes"})]}),t&&n.ft.jsx("div",{className:"analytics-debugger-tabs",children:t==="Events"?n.ft.jsx(C,{data:m,setTooltips:e}):n.ft.jsx(D,{data:m,setTooltips:e})})]}),n.ft.jsx($,{tooltips:s})]}):null}const Y=()=>{const t={};return Object.values(m).forEach(a=>{a.events.forEach(s=>{const{originalEventName:e}=s.eventData;t[e]||(t[e]=[]),!t[e].find(i=>i.el===s.el)&&t[e].push(s)})}),t};function C(t){const{setTooltips:a}=t,[s,e]=n.reactExports.useState([]),[i,c]=n.reactExports.useState(""),l=(o,g)=>{s.forEach(r=>r.classList.remove("analytics-event-highlight"));const d=o.map(r=>(r.el.scrollIntoView({behavior:"smooth",block:"nearest"}),r.el.classList.add("analytics-event-highlight"),r.el));e(d),c(g),a(o.map((r,u)=>({elem:r.el,key:`${r.eventData.originalEventName}_${u}`,action:r.eventData.action,originalEventName:r.eventData.originalEventName,scope:r.eventData.scope})))};return n.ft.jsxs("div",{className:"analytics-debugger-tab",children:[n.ft.jsx("h2",{className:"analytics-debugger-tab-title",children:"Event Names"}),n.ft.jsx("ul",{className:"analytics-debugger-list",children:Object.entries(Y()).map(([o,g],d)=>{const r=`${o}_${d}`;return n.ft.jsx("li",{className:"analytics-debugger-listItem",children:n.ft.jsx("button",{className:n.oa("analytics-debugger-button",{"is-active":r===i}),onClick:()=>l(g,r),children:o})},r)})})]})}function D(t){const{data:a,setTooltips:s}=t,[e,i]=n.reactExports.useState(""),c=l=>{const o=a[l];o.scopeEl&&(o.scopeEl.scrollIntoView({behavior:"smooth",block:"nearest"}),i(l),s(o.events.map((g,d)=>{const r=g.eventData;return{elem:g.el,key:`${r.originalEventName}_${d}`,action:r.action,originalEventName:r.originalEventName,scope:r.scope}})))};return n.ft.jsxs("div",{className:"analytics-debugger-tab",children:[n.ft.jsx("h2",{className:"analytics-debugger-tab-title",children:"Scope Names"}),n.ft.jsx("ul",{className:"analytics-debugger-list",children:Object.keys(a).map((l,o)=>{if(l!==j)return n.ft.jsx("li",{className:"analytics-debugger-listItem",children:n.ft.jsx("button",{className:n.oa("analytics-debugger-button",{"is-active":l===e}),onClick:()=>c(l),children:l})},l+o)})})]})}function $(t){const a=n.reactExports.useRef({});return n.reactExports.useEffect(()=>{if(a.current)for(const s of Object.values(a.current)){const e=Object.values(a.current).map(i=>i.el).filter(i=>i!==s.el);O(s,e),s.el.style.visibility="visible"}},[t.tooltips]),n.ft.jsx(n.ft.Fragment,{children:t.tooltips.map(s=>n.ft.jsxs("div",{style:{visibility:"hidden"},className:"analytics-debugger-tooltip",ref:e=>{e?a.current[s.key]={el:e,tooltip:s}:delete a.current[s.key]},children:[n.ft.jsxs("span",{children:["Action: ",s.action]}),n.ft.jsx("br",{}),n.ft.jsxs("span",{children:["Scope: ",s.scope]}),n.ft.jsx("br",{}),n.ft.jsxs("span",{children:["Original Event Name: ",s.originalEventName]})]},s.key))})}function O(t,a){for(let s=0;s<9;s++){const e=I(t.tooltip.elem.getBoundingClientRect(),t.el,s);if(t.el.style.inset=`${e.top} auto auto ${e.left}`,!!B(t.el.getBoundingClientRect().left,t.el.getBoundingClientRect().top+window.scrollY,t.el.getBoundingClientRect().right,t.el.getBoundingClientRect().bottom+window.scrollY))continue;let i=!0;for(let c=0;c<a.length;c++){const l=a[c];R(t.el,l)&&(i=!1)}if(i)break}}function R(t,a){const s=t.getBoundingClientRect().top+window.scrollY,e=t.getBoundingClientRect().left,i=s+t.clientHeight,c=e+t.clientWidth,l=a.getBoundingClientRect().top+window.scrollY,o=a.getBoundingClientRect().left,g=l+a.clientHeight,d=o+a.clientWidth,r=(u,f,p,b,v,h,x,E)=>p<=v&&v<=x&&b<=h&&h<=E||p<=u&&u<=x&&b<=f&&f<=E||p<=u&&u<=x&&b<=h&&h<=E||p<=v&&v<=x&&b<=f&&f<=E;return r(e,s,o,l,c,i,d,g)||r(o,l,e,s,d,g,c,i)}function B(t,a,s,e){return t<0||s>window.innerWidth||a<0||e>document.documentElement.scrollHeight}function I(t,a,s){const e=a.clientHeight,i=a.clientWidth;let c,l;switch(s){case 0:{l=window.scrollY+t.top-e+"px",c=t.left-i+"px";break}case 1:{l=window.scrollY+t.top-e+"px",c=t.left+"px";break}case 2:{l=window.scrollY+t.top-e+"px",c=t.right+"px";break}case 3:{l=window.scrollY+t.top-e+"px",c=t.right-i+"px";break}case 4:{l=window.scrollY+t.bottom+"px",c=t.left-i+"px";break}case 5:{l=window.scrollY+t.bottom+"px",c=t.left+"px";break}case 6:{l=window.scrollY+t.bottom+"px",c=t.right-i+"px";break}case 7:{l=window.scrollY+t.bottom+"px",c=t.right+"px";break}default:l=0,c=0}return{top:l,left:c}}exports.AnalyticsDebuggerInternal=w;exports.default=N;
|