@next-bricks/visual-builder 1.13.1 → 1.14.0

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.
Files changed (88) hide show
  1. package/dist/bricks.json +10 -7
  2. package/dist/chunks/1045.3cfb5ba7.js +2 -0
  3. package/dist/chunks/{1045.8b4d10c4.js.map → 1045.3cfb5ba7.js.map} +1 -1
  4. package/dist/chunks/114.0be1e4c4.js +2 -0
  5. package/dist/chunks/{114.a9e98b1b.js.map → 114.0be1e4c4.js.map} +1 -1
  6. package/dist/chunks/{2252.d5b6e180.js → 2252.0c3cb8ac.js} +3 -3
  7. package/dist/chunks/{2252.d5b6e180.js.map → 2252.0c3cb8ac.js.map} +1 -1
  8. package/dist/chunks/2652.f0b2f28c.js +2 -0
  9. package/dist/chunks/2652.f0b2f28c.js.map +1 -0
  10. package/dist/chunks/{2980.17f0a298.js → 2980.86396d3b.js} +2 -2
  11. package/dist/chunks/{2980.17f0a298.js.map → 2980.86396d3b.js.map} +1 -1
  12. package/dist/chunks/{3171.e940cbee.js → 3171.b08430df.js} +2 -2
  13. package/dist/chunks/{3171.e940cbee.js.map → 3171.b08430df.js.map} +1 -1
  14. package/dist/chunks/{3933.ebc8e8f2.js → 3933.e03c2b23.js} +2 -2
  15. package/dist/chunks/{6314.b4d1e3d8.js.map → 3933.e03c2b23.js.map} +1 -1
  16. package/dist/chunks/{5552.a2515c4d.js → 5552.c7215ea8.js} +2 -2
  17. package/dist/chunks/{5552.a2515c4d.js.map → 5552.c7215ea8.js.map} +1 -1
  18. package/dist/chunks/{6314.b4d1e3d8.js → 6314.6b069355.js} +2 -2
  19. package/dist/chunks/{3933.ebc8e8f2.js.map → 6314.6b069355.js.map} +1 -1
  20. package/dist/chunks/7115.06a979c3.js +2 -0
  21. package/dist/chunks/7115.06a979c3.js.map +1 -0
  22. package/dist/chunks/7733.a6c1c97f.js +2 -0
  23. package/dist/chunks/{7733.b04ef47a.js.map → 7733.a6c1c97f.js.map} +1 -1
  24. package/dist/chunks/{790.3507adfd.js → 790.751cea2b.js} +2 -2
  25. package/dist/chunks/{790.3507adfd.js.map → 790.751cea2b.js.map} +1 -1
  26. package/dist/chunks/8708.1ea15d61.js +3 -0
  27. package/dist/chunks/8708.1ea15d61.js.map +1 -0
  28. package/dist/chunks/9027.901c70c3.js +2 -0
  29. package/dist/chunks/9027.901c70c3.js.map +1 -0
  30. package/dist/chunks/9496.a22edebd.js +2 -0
  31. package/dist/chunks/9496.a22edebd.js.map +1 -0
  32. package/dist/chunks/{chat-preview.f53383e4.js → chat-preview.93091ff7.js} +3 -3
  33. package/dist/chunks/{chat-preview.f53383e4.js.map → chat-preview.93091ff7.js.map} +1 -1
  34. package/dist/chunks/{contract-select.ad0fba9a.js → contract-select.f1ab9ac5.js} +3 -3
  35. package/dist/chunks/{contract-select.ad0fba9a.js.map → contract-select.f1ab9ac5.js.map} +1 -1
  36. package/dist/chunks/{inject-chat-preview-agent.da30e6ca.js → inject-chat-preview-agent.fa33d2da.js} +2 -2
  37. package/dist/chunks/{inject-chat-preview-agent.da30e6ca.js.map → inject-chat-preview-agent.fa33d2da.js.map} +1 -1
  38. package/dist/chunks/{inject-preview-agent.ef222436.js → inject-preview-agent.f5b2e43f.js} +2 -2
  39. package/dist/chunks/{inject-preview-agent.ef222436.js.map → inject-preview-agent.f5b2e43f.js.map} +1 -1
  40. package/dist/chunks/main.dc3cb140.js +2 -0
  41. package/dist/chunks/main.dc3cb140.js.map +1 -0
  42. package/dist/chunks/pre-generated-container.a4753ca8.js +2 -0
  43. package/dist/chunks/pre-generated-container.a4753ca8.js.map +1 -0
  44. package/dist/chunks/pre-generated-preview.3f7df187.js +3 -0
  45. package/dist/chunks/pre-generated-preview.3f7df187.js.LICENSE.txt +5 -0
  46. package/dist/chunks/pre-generated-preview.3f7df187.js.map +1 -0
  47. package/dist/chunks/pre-generated-table-view.cf8a978d.js +2 -0
  48. package/dist/chunks/pre-generated-table-view.cf8a978d.js.map +1 -0
  49. package/dist/chunks/{workbench-action-list.384f5582.js → workbench-action-list.92325154.js} +2 -2
  50. package/dist/chunks/{workbench-action-list.384f5582.js.map → workbench-action-list.92325154.js.map} +1 -1
  51. package/dist/chunks/{workbench-history-action.881387c9.js → workbench-history-action.2c7308db.js} +3 -3
  52. package/dist/chunks/{workbench-history-action.881387c9.js.map → workbench-history-action.2c7308db.js.map} +1 -1
  53. package/dist/index.86992f43.js +2 -0
  54. package/dist/index.86992f43.js.map +1 -0
  55. package/dist/manifest.json +109 -47
  56. package/dist/types.json +311 -57
  57. package/dist-types/bootstrap.d.ts +3 -0
  58. package/dist-types/pre-generated-container/index.d.ts +19 -0
  59. package/dist-types/pre-generated-container/index.spec.d.ts +1 -0
  60. package/dist-types/pre-generated-preview/index.d.ts +42 -0
  61. package/dist-types/pre-generated-preview/index.spec.d.ts +1 -0
  62. package/dist-types/pre-generated-table-view/index.d.ts +12 -0
  63. package/dist-types/pre-generated-table-view/index.spec.d.ts +1 -0
  64. package/package.json +3 -3
  65. package/dist/chunks/1045.8b4d10c4.js +0 -2
  66. package/dist/chunks/114.a9e98b1b.js +0 -2
  67. package/dist/chunks/2154.142671d1.js +0 -3
  68. package/dist/chunks/2154.142671d1.js.map +0 -1
  69. package/dist/chunks/2652.8b225b3b.js +0 -2
  70. package/dist/chunks/2652.8b225b3b.js.map +0 -1
  71. package/dist/chunks/3426.10d61df1.js +0 -2
  72. package/dist/chunks/3426.10d61df1.js.map +0 -1
  73. package/dist/chunks/7115.ae98e709.js +0 -2
  74. package/dist/chunks/7115.ae98e709.js.map +0 -1
  75. package/dist/chunks/7733.b04ef47a.js +0 -2
  76. package/dist/chunks/9027.cff50414.js +0 -2
  77. package/dist/chunks/9027.cff50414.js.map +0 -1
  78. package/dist/chunks/9496.1ec84446.js +0 -2
  79. package/dist/chunks/9496.1ec84446.js.map +0 -1
  80. package/dist/chunks/main.8fa72e42.js +0 -2
  81. package/dist/chunks/main.8fa72e42.js.map +0 -1
  82. package/dist/index.7872073f.js +0 -2
  83. package/dist/index.7872073f.js.map +0 -1
  84. /package/dist/chunks/{2252.d5b6e180.js.LICENSE.txt → 2252.0c3cb8ac.js.LICENSE.txt} +0 -0
  85. /package/dist/chunks/{2154.142671d1.js.LICENSE.txt → 8708.1ea15d61.js.LICENSE.txt} +0 -0
  86. /package/dist/chunks/{chat-preview.f53383e4.js.LICENSE.txt → chat-preview.93091ff7.js.LICENSE.txt} +0 -0
  87. /package/dist/chunks/{contract-select.ad0fba9a.js.LICENSE.txt → contract-select.f1ab9ac5.js.LICENSE.txt} +0 -0
  88. /package/dist/chunks/{workbench-history-action.881387c9.js.LICENSE.txt → workbench-history-action.2c7308db.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
- "use strict";(self.webpackChunk_next_bricks_visual_builder=self.webpackChunk_next_bricks_visual_builder||[]).push([[2980],{4940:(e,n,o)=>{o.d(n,{e:()=>a,l:()=>l});var t=o(8769),a=(0,t.createContext)({});function l(){return(0,t.useContext)(a)}},7758:(e,n,o)=>{o.d(n,{cU:()=>N});var t=o(9575),a=o(9740),l=o(8769),r=o.n(l),i=o(1030),c=o.n(i),s=o(3373),d=o.n(s),u=o(9406),p=o(4940),f=function(e){return e.inside="inside",e.top="top",e.bottom="bottom",e}({}),h=(0,l.createContext)({});function m(){return(0,l.useContext)(h)}var b=o(6430),v=o(2630),g=(0,b.wrapBrick)("eo-icon");function x(e){var{data:n,className:o,gap:t,isFirst:a,isLast:i,actions:c,actionsHidden:s,onActionClick:u}=e,p=(0,l.useMemo)((()=>null==c?void 0:c.filter((e=>(0,v.checkIfByTransform)(e,n)))),[c,n]);return s||null==p||!p.length?null:r().createElement("div",{className:d()("actionsBar",o),style:{gap:t}},p.map((e=>r().createElement(k,{key:e.action,action:e,data:n,isFirst:a,isLast:i,onActionClick:u}))))}function k(e){var{action:n,data:o,isFirst:t,isLast:a,onActionClick:i}=e,c=t&&"move-up"===n.action||a&&"move-down"===n.action,s=(0,l.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),c||null==i||i({action:n.action,data:o})}),[n.action,o,c,i]),u=(0,l.useCallback)((e=>{e.preventDefault(),e.stopPropagation()}),[]);return r().createElement("a",{className:d()("action",{disabled:c}),title:n.title,role:"button",onClick:s,onContextMenu:u,onMouseDown:u},r().createElement(g,n.icon))}var y=(0,b.wrapBrick)("eo-link"),w=(0,b.wrapBrick)("eo-icon"),E=10,C="0 0 0 1px #ba6d30",L=(0,l.createContext)(!1);function N(e){var{nodes:n,placeholder:o,searchPlaceholder:t,isDrag:a,noSearch:i,allowDrag:s,allowDragToRoot:p,allowDragToInside:m,dropEmit:b}=e,[v,g]=(0,l.useState)(""),[x,k]=(0,l.useState)(a),[y,E]=(0,l.useState)(),[C,N]=(0,l.useState)(),[A,I]=(0,l.useState)(),[M,B]=(0,l.useState)(),[D,R]=(0,l.useState)(),[P,F]=(0,l.useState)(),{nodeKey:T,onBrickDrop:O,contextMenuFactory:j,matchNode:z}=(0,u.o)(),_=(0,l.useMemo)((()=>{var e;return function(e,n){var o=(e,t,a,l)=>{var r=e.shift();if(r){e.length>0&&e.splice(0,1,"".concat(r,"/").concat(e[0]));var i=t.find((e=>e&&e.key===r&&e.isContainer));if(i)t[l]=null,o(e,i.children,a);else{var c=r.split("/"),s={name:c.pop(),key:r,parentPath:c?c.join("/"):c,originKey:a.key,data:{[n]:r,isContainer:!0},children:[],icon:{icon:"folder",lib:"antd",theme:"filled",color:"orange"},isContainer:!0};"number"==typeof l?t[l]=s:t.push(s),o(e,s.children,a)}}else t.push(a)};return e.forEach(((n,t)=>{if(n.path){var a=n.path.split("/").filter(Boolean);o(a,e,n,t)}})),e.filter(Boolean)}(null!==(e=null==n?void 0:n.slice())&&void 0!==e?e:[],T)}),[n,T]),K=(0,l.useCallback)((e=>{g(e.target.value)}),[]),W=(0,l.useMemo)((()=>null==j?void 0:j()),[j]),$=null==v?void 0:v.trim().toLowerCase(),H=(0,l.useMemo)((()=>{if(i||!$||!_)return _;var e=n=>{var o;n.matchedSelf=z(n,$);var t=null===(o=n.children)||void 0===o?void 0:o.map(e).includes(!0);return n.matched=n.matchedSelf||t,n.matched};return _.forEach(e),_.slice()}),[i,$,_,z]),U=function(e){for(var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],o=e;o;){if(o.draggable&&(n||o!==e)&&"A"!==o.tagName)return o;o=o.parentElement}},Y=function(e,n,o){var t=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;for(var a of e)if(a.data[o]===n&&(t=a),a.children&&(t=Y(a.children,n,o,t)),t)break;return t},V=()=>{N(null),B(null),I(null),R(null),k(!1)};return(0,l.useEffect)((()=>{k(a)}),[a]),(0,l.useEffect)((()=>(window.addEventListener("dragend",V),()=>{window.removeEventListener("dragend",V)})),[]),r().createElement("div",{style:{height:"100%"},className:"tree-wrapper",onContextMenu:W},null!=_&&_.length?r().createElement("div",null,!i&&r().createElement("div",{className:"searchBox",onContextMenu:e=>e.stopPropagation()},r().createElement("span",{className:d()("filter-input-wrapper",{focus:P})},r().createElement("span",{className:"prefix"},r().createElement(w,{icon:"search",lib:"antd",theme:"outlined"})),r().createElement("input",{value:v,onChange:K,onFocus:()=>F(!0),onBlur:()=>F(!1),autoComplete:"off",placeholder:t}),r().createElement("span",{className:"suffix"},v?r().createElement(w,{className:"clear-button",icon:"close-circle",lib:"antd",theme:"filled",onClick:()=>{g("")}}):null))),r().createElement(L.Provider,{value:!!v},r().createElement(h.Provider,{value:{allow:s,allowDragToRoot:p,dragElement:C,dragOverElement:M,dragStatus:D,onDragStart:(e,n)=>{var o;if(e.stopPropagation(),s){var t=e.target;null!==(o=t.dataset)&&void 0!==o&&o.container||(k(!0),function(e,n){var o=document.createElement("canvas");document.body.append(o);var t=o.getContext("2d");o.width=t.measureText(n).width+60,o.height=20,o.style.position="absolute",o.style.left="-100%",o.style.zIndex="-100",t.fillStyle="#333333",t.fillRect(0,0,o.width,o.height),t.fillStyle="#999999",t.font="bold 14px Arial",t.fillText(n,20,15),e.dataTransfer.setDragImage(o,0,0)}(e,t.innerText),N(t),E(n))}}}},r().createElement("div",{className:d()({hightlight:a}),onDragOver:e=>{if(e.preventDefault(),x&&"workbenchTree-placeholder-dom"!==e.target.className){var n=(e=>{var n=U(e.target),o=n.dataset.uid;if(!(n===C||null!=o&&o.includes(":"))){var t,{top:a,bottom:l}=n.getBoundingClientRect(),r=m?5:10;return t=e.clientY<a+r?f.top:e.clientY>l-r?f.bottom:m?f.inside:D,{element:n,node:Y(_,o,T),status:t}}})(e);!n||null!=C&&C.contains(n.element)||(B(n.element),I(n.node),R(n.status))}},onDrop:e=>{if(x){if(O){var n=M;[f.top,f.bottom].includes(D)&&(n=U(n,!1)),O(e,{curElement:C,overElement:M,parentElement:n,overStatus:D})}else if(p||1!==Number(M.dataset.level)){var o=A,t=(e,n)=>{for(var a=0;a<e.length;a++){if(e[a].key===n){o=e[a];break}e[a].children&&t(e[a].children,n)}},a=M.dataset.uid;t(_,a);var l=e=>{var n=!1,{container:t,uid:a}=M.dataset,r=t?o.originKey:a,i=e.filter((e=>(e.children&&(e.children=l(e.children)),e.key===r&&(n=!0),e.key!==y.key)));return n&&i.splice(i.findIndex((e=>e.key===r))+("bottom"===D?1:0),0,y),i},r=function(e){var n=[],o=e=>{e.forEach((e=>{e.isContainer?o(e.children):n.push(c().omit(e,["path","icon"]))}))};return o(e),n}(_),i=y.isContainer?r.find((e=>e.key===y.originKey)):y;i.data.path=o.parentPath||o.path,b({nodes:l(r),curNode:i,overNode:o,status:D})}V()}}},r().createElement(S,{nodes:H,level:1}))))):r().createElement("div",{className:"placeholder"},o))}function S(e){var{nodes:n,level:o}=e,t=n.length-1;return r().createElement("ul",{className:"tree"},n.filter((e=>(0,v.checkIfOfComputed)(e))).map(((e,n)=>r().createElement(I,{key:e.key,node:e,level:o,isFirst:0===n,isLast:n===t}))))}function A(e){var{style:n}=e,{dragStatus:o}=m(),t=(0,a.A)({height:22,border:"1px dashed goldenrod",opacity:o===f.inside?"0":"1"},n);return r().createElement("li",{className:"workbenchTree-placeholder-dom",style:t})}function I(e){var n,o,c,s,{node:h,level:b,isFirst:v,isLast:g}=e,k=!(null!==(n=h.children)&&void 0!==n&&n.length),N=h.isContainer,{hoverKey:I,activeKey:M,basePaddingLeft:B,showMatchedNodeOnly:D,fixedActionsFor:R,collapsible:P,collapsedNodes:F,nodeKey:T,clickFactory:O,mouseEnterFactory:j,mouseLeaveFactory:z,contextMenuFactory:_,onNodeToggle:K,getCollapsedId:W,skipNotify:$}=(0,u.o)(),{allow:H,allowDragToRoot:U,onDragStart:Y,dragElement:V,dragOverElement:q,dragStatus:G}=m(),{actions:J,actionsHidden:Q,onActionClick:X}=(0,p.l)(),Z=b*E+B-2,ee=(0,l.useContext)(L),[ne,oe]=(0,l.useState)(null),[te,ae]=(0,l.useState)(!1),[le,re]=(0,l.useState)(null!==(o=null==F?void 0:F.includes(null==W?void 0:W(h)))&&void 0!==o&&o),ie=(0,l.useMemo)((()=>null==j?void 0:j(h)),[j,h]),ce=(0,l.useMemo)((()=>null==z?void 0:z(h)),[z,h]),se=(0,l.useCallback)((e=>{var n;e.stopPropagation(),null==_||null===(n=_(h))||void 0===n||n(e)}),[_,h]),de=M&&h.key===M,ue=(0,l.useMemo)((()=>de?e=>{var n;null==e||null===(n=e.scrollIntoView)||void 0===n||n.call(e,{block:"center",inline:"center"})}:null),[]),pe=(0,l.useMemo)((()=>{return N?h.key:h.data?"mount-point"===(e=h.data).type?e.parent[T]||"".concat(e.parent.$$uid,":").concat(e.mountPoint):e[T]||e.$$uid:void 0;var e}),[T,h,N]);(0,l.useEffect)((()=>{G!==f.inside&&[f.top,f.bottom].includes(G)&&oe(G)}),[G]);var fe=(0,l.useMemo)((()=>!!V&&V.dataset.uid===String(pe)),[V,pe]),he=(0,l.useMemo)((()=>!!q&&q.dataset.uid===String(pe)),[q,pe]),me=(0,l.useMemo)((()=>{var e={opacity:fe?.2:1};return he&&G===f.inside&&(e={boxShadow:C,background:"rgba(255, 255, 255, 0.1)"}),Object.assign({},e)}),[he,fe,G]),be=(0,l.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),ae(!0),re((e=>!e))}),[]),ve=(0,l.useCallback)((e=>{e.preventDefault(),e.stopPropagation()}),[]),ge=(0,l.useCallback)((e=>{var n;if(!N)return null==O||null===(n=O(h))||void 0===n?void 0:n();be(e)}),[O,be,N,h]);(0,l.useEffect)((()=>{te&&(null==K||K(null==W?void 0:W(h),le))}),[te,le,W,h,K]);var xe=P&&!k&&!ee;return ee&&D&&!h.matched?null:r().createElement(r().Fragment,null,he&&(U||1!==b)&&ne===f.top&&r().createElement(A,{style:{marginLeft:Z}}),r().createElement("li",(0,t.A)({draggable:H,onDragStart:e=>Y(e,h),"data-uid":pe,"data-level":b,style:me},N?{"data-container":N}:{}),r().createElement(y,(0,t.A)({className:"nodeLabelLink",tabIndex:0,onMouseEnter:ie,onMouseLeave:ce,onContextMenu:se,onClick:ge},$?{url:{pathname:(0,i.get)(h.link,"url","href"),state:{notify:!1}}}:(0,a.A)({},(0,i.pick)(h.link,["url","href"]))),r().createElement("span",{className:d()("nodeLabelRow",{active:de,hover:I&&h.key===I,matched:ee&&h.matchedSelf&&!D,fixedActions:R&&[].concat(R).some((e=>(0,i.isMatch)(h.data,e))),collapsed:xe&&le,collapsible:xe})},r().createElement("span",{className:d()("nodeLabel",{unreachable:h.unreachable}),style:{paddingLeft:Z,color:h.labelColor},ref:ue},r().createElement("span",{className:"nodeIconWrapper"},xe&&r().createElement("span",{className:"collapseIcon",onClick:be,onMouseDown:ve,title:le?"Expand":"Collapse",role:"button"},r().createElement(w,{lib:"antd",theme:"outlined",icon:le?"right":"down"})),r().createElement("span",{className:"nodeIcon"},r().createElement(w,(0,t.A)({},h.icon,{style:{fontSize:null!==(c=h.icon)&&void 0!==c&&c.imgSrc?14:null,color:null===(s=h.icon)||void 0===s?void 0:s.color}})))),r().createElement("span",{className:"nodeName"},h.labelPrefix&&r().createElement("span",{style:h.labelPrefix.style},h.labelPrefix.text),h.name)),r().createElement(x,{className:"nodeActionsBar",data:h.data,isFirst:v,isLast:g,actions:J,onActionClick:X,actionsHidden:Q}),h.badge&&r().createElement("span",{className:"badge"},r().createElement(w,(0,t.A)({},h.badge,{style:{color:h.badge.color}}))))),k||r().createElement(S,{nodes:h.children,level:b+1})),he&&(U||1!==b)&&ne===f.bottom&&r().createElement(A,{style:{marginLeft:Z}}))}},9406:(e,n,o)=>{o.d(n,{N:()=>a,o:()=>l});var t=o(8769),a=(0,t.createContext)({});function l(){return(0,t.useContext)(a)}},675:(e,n,o)=>{function t(e,n){switch(typeof e){case"string":return e.toLowerCase().includes(n);case"boolean":case"number":return String(e).includes(n);case"object":return null===e?"null".includes(n):(Array.isArray(e)?e:Object.entries(e).flat()).some((e=>t(e,n)));default:return!1}}o.d(n,{U:()=>t})},6275:(e,n,o)=>{o.d(n,{A:()=>i});var t=o(6758),a=o.n(t),l=o(935),r=o.n(l)()(a());r.push([e.id,".actionsBar{display:flex;align-items:center;padding:0 3px}.action{display:flex;justify-content:center;align-items:center;width:20px;height:20px;border-radius:5px}.action:hover{color:#fff;background-color:rgba(90,93,94,0.31)}.action{color:#c5c5c5}.disabled,\n.disabled:hover{color:var(--color-disabled-text);cursor:not-allowed;background-color:initial}",""]);const i=r.toString()},7995:(e,n,o)=>{o.d(n,{A:()=>i});var t=o(6758),a=o.n(t),l=o(935),r=o.n(l)()(a());r.push([e.id,':host,\n:host-context(html[data-override-theme="light"]){--search-box-background:#fff;--node-color:#595959;--node-color-focus:#595959;--node-background-active:#e0eeff;--node-background-focus:#e0eeff;--node-icon-background-hover:#fff}:host-context(html[data-theme="dark-v2"]),\n:host-context(html[data-override-theme="dark-v2"]){--search-box-background:#181818;--node-color:#c5c5c5;--node-color-focus:#fff;--node-background-active:rgba(255,255,255,0.08);--node-background-focus:#1a7aff;--node-icon-background-hover:rgba(90,93,94,0.31)}.searchBox{position:-webkit-sticky;position:sticky;top:0;background-color:var(--search-box-background);padding:5px 10px 10px;z-index:1}.searchBox .filter-input-wrapper{background-color:var(--search-box-background);border:1px solid rgba(255,255,255,0.2);position:relative;width:100%;min-width:0;padding:2px 7px;color:var(--antd-input-color);font-size:14px;line-height:1.5715;display:inline-flex;border-radius:3px;transition:all 0.3s;box-sizing:border-box}.searchBox .filter-input-wrapper.focus{background-color:var(--search-box-background);border:1px solid rgba(255,255,255,0.2);border-right-width:1px!important;outline:0;box-shadow:0 0 0 2px rgba(0,113,235,0.2)}.searchBox .filter-input-wrapper input{text-overflow:ellipsis;border:none;outline:none;border-radius:3px;background-color:var(--search-box-background);box-sizing:border-box;margin:0;padding:0;color:var(--antd-text-color);font-variant:tabular-nums;list-style:none;font-feature-settings:"tnum";position:relative;display:inline-block;width:100%;min-width:0;color:var(--antd-input-color);font-size:14px;line-height:1.5715;background-image:none;transition:all 0.3s}.prefix{margin-right:4px}.suffix{margin-left:4px}.searchBox .prefix,\n.searchBox .suffix{display:flex;flex:none;align-items:center}.clear-button{cursor:pointer}.tree{list-style:none;margin:0;padding:0}.placeholder{color:var(--antd-input-placeholder-color);padding:0 15px}.nodeLabelLink{display:block}.nodeLabelLink::part(link){display:flex}.nodeLabelRow{display:flex;cursor:pointer;height:22px;padding-right:10px;flex:1;min-width:0}.nodeLabelRow:hover,\n.nodeLabelRow.hover{background-color:rgba(255,255,255,0.12)}.nodeLabelLink:focus .nodeLabelRow.active{background-color:var(--node-background-focus)}.nodeLabel{display:flex;align-items:center;min-width:0;flex:1}.unreachable{opacity:0.3}.nodeAction,\n.nodeAction:hover,\n.nodeLabelRow .nodeLabel{color:var(--node-color)}.nodeLabelLink:focus .nodeLabel{color:var(--node-color-focus)}.nodeLabelRow.matched .nodeLabel{color:var(--palette-orange-6)}.nodeLabelRow.active{background-color:var(--node-background-active)}.nodeIconWrapper{display:flex;width:24px;flex-shrink:0}.nodeIcon,\n.collapseIcon{display:flex;justify-content:center;align-items:center;width:20px;height:20px;border-radius:5px;font-size:13px}.collapseIcon{display:none}.nodeLabelRow.collapsed .nodeIcon,\n.nodeLabelRow.collapsible .nodeIconWrapper:hover .nodeIcon{display:none}.nodeLabelRow.collapsed .collapseIcon,\n.nodeLabelRow.collapsible .nodeIconWrapper:hover .collapseIcon{display:flex}.nodeLabelRow.collapsible .nodeIcon:hover,\n.nodeLabelRow.collapsible .collapseIcon:hover{background-color:var(--node-icon-background-hover)}.nodeName{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.nodeLabelRow:not(:hover, .fixedActions) .nodeActionsBar{display:none}.badge{margin:0 3px}.collapsed + .tree{display:none}.hightlight{outline-width:1px;outline-style:solid;outline-offset:-1px;outline-color:#fcd93f}',""]);const i=r.toString()},9575:(e,n,o)=>{function t(){return t=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var o=arguments[n];for(var t in o)Object.prototype.hasOwnProperty.call(o,t)&&(e[t]=o[t])}return e},t.apply(this,arguments)}o.d(n,{A:()=>t})}}]);
2
- //# sourceMappingURL=2980.17f0a298.js.map
1
+ "use strict";(self.webpackChunk_next_bricks_visual_builder=self.webpackChunk_next_bricks_visual_builder||[]).push([[2980],{4940:(e,n,o)=>{o.d(n,{e:()=>a,l:()=>l});var t=o(8769),a=(0,t.createContext)({});function l(){return(0,t.useContext)(a)}},7758:(e,n,o)=>{o.d(n,{cU:()=>N});var t=o(9575),a=o(9740),l=o(8769),r=o.n(l),i=o(1030),c=o.n(i),s=o(3373),d=o.n(s),u=o(9406),p=o(4940),f=function(e){return e.inside="inside",e.top="top",e.bottom="bottom",e}({}),h=(0,l.createContext)({});function m(){return(0,l.useContext)(h)}var b=o(6430),v=o(7860),g=(0,b.wrapBrick)("eo-icon");function x(e){var{data:n,className:o,gap:t,isFirst:a,isLast:i,actions:c,actionsHidden:s,onActionClick:u}=e,p=(0,l.useMemo)((()=>null==c?void 0:c.filter((e=>(0,v.checkIfByTransform)(e,n)))),[c,n]);return s||null==p||!p.length?null:r().createElement("div",{className:d()("actionsBar",o),style:{gap:t}},p.map((e=>r().createElement(k,{key:e.action,action:e,data:n,isFirst:a,isLast:i,onActionClick:u}))))}function k(e){var{action:n,data:o,isFirst:t,isLast:a,onActionClick:i}=e,c=t&&"move-up"===n.action||a&&"move-down"===n.action,s=(0,l.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),c||null==i||i({action:n.action,data:o})}),[n.action,o,c,i]),u=(0,l.useCallback)((e=>{e.preventDefault(),e.stopPropagation()}),[]);return r().createElement("a",{className:d()("action",{disabled:c}),title:n.title,role:"button",onClick:s,onContextMenu:u,onMouseDown:u},r().createElement(g,n.icon))}var y=(0,b.wrapBrick)("eo-link"),w=(0,b.wrapBrick)("eo-icon"),E=10,C="0 0 0 1px #ba6d30",L=(0,l.createContext)(!1);function N(e){var{nodes:n,placeholder:o,searchPlaceholder:t,isDrag:a,noSearch:i,allowDrag:s,allowDragToRoot:p,allowDragToInside:m,dropEmit:b}=e,[v,g]=(0,l.useState)(""),[x,k]=(0,l.useState)(a),[y,E]=(0,l.useState)(),[C,N]=(0,l.useState)(),[A,I]=(0,l.useState)(),[M,B]=(0,l.useState)(),[D,R]=(0,l.useState)(),[P,F]=(0,l.useState)(),{nodeKey:T,onBrickDrop:O,contextMenuFactory:j,matchNode:z}=(0,u.o)(),_=(0,l.useMemo)((()=>{var e;return function(e,n){var o=(e,t,a,l)=>{var r=e.shift();if(r){e.length>0&&e.splice(0,1,"".concat(r,"/").concat(e[0]));var i=t.find((e=>e&&e.key===r&&e.isContainer));if(i)t[l]=null,o(e,i.children,a);else{var c=r.split("/"),s={name:c.pop(),key:r,parentPath:c?c.join("/"):c,originKey:a.key,data:{[n]:r,isContainer:!0},children:[],icon:{icon:"folder",lib:"antd",theme:"filled",color:"orange"},isContainer:!0};"number"==typeof l?t[l]=s:t.push(s),o(e,s.children,a)}}else t.push(a)};return e.forEach(((n,t)=>{if(n.path){var a=n.path.split("/").filter(Boolean);o(a,e,n,t)}})),e.filter(Boolean)}(null!==(e=null==n?void 0:n.slice())&&void 0!==e?e:[],T)}),[n,T]),K=(0,l.useCallback)((e=>{g(e.target.value)}),[]),W=(0,l.useMemo)((()=>null==j?void 0:j()),[j]),$=null==v?void 0:v.trim().toLowerCase(),H=(0,l.useMemo)((()=>{if(i||!$||!_)return _;var e=n=>{var o;n.matchedSelf=z(n,$);var t=null===(o=n.children)||void 0===o?void 0:o.map(e).includes(!0);return n.matched=n.matchedSelf||t,n.matched};return _.forEach(e),_.slice()}),[i,$,_,z]),U=function(e){for(var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],o=e;o;){if(o.draggable&&(n||o!==e)&&"A"!==o.tagName)return o;o=o.parentElement}},Y=function(e,n,o){var t=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;for(var a of e)if(a.data[o]===n&&(t=a),a.children&&(t=Y(a.children,n,o,t)),t)break;return t},V=()=>{N(null),B(null),I(null),R(null),k(!1)};return(0,l.useEffect)((()=>{k(a)}),[a]),(0,l.useEffect)((()=>(window.addEventListener("dragend",V),()=>{window.removeEventListener("dragend",V)})),[]),r().createElement("div",{style:{height:"100%"},className:"tree-wrapper",onContextMenu:W},null!=_&&_.length?r().createElement("div",null,!i&&r().createElement("div",{className:"searchBox",onContextMenu:e=>e.stopPropagation()},r().createElement("span",{className:d()("filter-input-wrapper",{focus:P})},r().createElement("span",{className:"prefix"},r().createElement(w,{icon:"search",lib:"antd",theme:"outlined"})),r().createElement("input",{value:v,onChange:K,onFocus:()=>F(!0),onBlur:()=>F(!1),autoComplete:"off",placeholder:t}),r().createElement("span",{className:"suffix"},v?r().createElement(w,{className:"clear-button",icon:"close-circle",lib:"antd",theme:"filled",onClick:()=>{g("")}}):null))),r().createElement(L.Provider,{value:!!v},r().createElement(h.Provider,{value:{allow:s,allowDragToRoot:p,dragElement:C,dragOverElement:M,dragStatus:D,onDragStart:(e,n)=>{var o;if(e.stopPropagation(),s){var t=e.target;null!==(o=t.dataset)&&void 0!==o&&o.container||(k(!0),function(e,n){var o=document.createElement("canvas");document.body.append(o);var t=o.getContext("2d");o.width=t.measureText(n).width+60,o.height=20,o.style.position="absolute",o.style.left="-100%",o.style.zIndex="-100",t.fillStyle="#333333",t.fillRect(0,0,o.width,o.height),t.fillStyle="#999999",t.font="bold 14px Arial",t.fillText(n,20,15),e.dataTransfer.setDragImage(o,0,0)}(e,t.innerText),N(t),E(n))}}}},r().createElement("div",{className:d()({hightlight:a}),onDragOver:e=>{if(e.preventDefault(),x&&"workbenchTree-placeholder-dom"!==e.target.className){var n=(e=>{var n=U(e.target),o=n.dataset.uid;if(!(n===C||null!=o&&o.includes(":"))){var t,{top:a,bottom:l}=n.getBoundingClientRect(),r=m?5:10;return t=e.clientY<a+r?f.top:e.clientY>l-r?f.bottom:m?f.inside:D,{element:n,node:Y(_,o,T),status:t}}})(e);!n||null!=C&&C.contains(n.element)||(B(n.element),I(n.node),R(n.status))}},onDrop:e=>{if(x){if(O){var n=M;[f.top,f.bottom].includes(D)&&(n=U(n,!1)),O(e,{curElement:C,overElement:M,parentElement:n,overStatus:D})}else if(p||1!==Number(M.dataset.level)){var o=A,t=(e,n)=>{for(var a=0;a<e.length;a++){if(e[a].key===n){o=e[a];break}e[a].children&&t(e[a].children,n)}},a=M.dataset.uid;t(_,a);var l=e=>{var n=!1,{container:t,uid:a}=M.dataset,r=t?o.originKey:a,i=e.filter((e=>(e.children&&(e.children=l(e.children)),e.key===r&&(n=!0),e.key!==y.key)));return n&&i.splice(i.findIndex((e=>e.key===r))+("bottom"===D?1:0),0,y),i},r=function(e){var n=[],o=e=>{e.forEach((e=>{e.isContainer?o(e.children):n.push(c().omit(e,["path","icon"]))}))};return o(e),n}(_),i=y.isContainer?r.find((e=>e.key===y.originKey)):y;i.data.path=o.parentPath||o.path,b({nodes:l(r),curNode:i,overNode:o,status:D})}V()}}},r().createElement(S,{nodes:H,level:1}))))):r().createElement("div",{className:"placeholder"},o))}function S(e){var{nodes:n,level:o}=e,t=n.length-1;return r().createElement("ul",{className:"tree"},n.filter((e=>(0,v.checkIfOfComputed)(e))).map(((e,n)=>r().createElement(I,{key:e.key,node:e,level:o,isFirst:0===n,isLast:n===t}))))}function A(e){var{style:n}=e,{dragStatus:o}=m(),t=(0,a.A)({height:22,border:"1px dashed goldenrod",opacity:o===f.inside?"0":"1"},n);return r().createElement("li",{className:"workbenchTree-placeholder-dom",style:t})}function I(e){var n,o,c,s,{node:h,level:b,isFirst:v,isLast:g}=e,k=!(null!==(n=h.children)&&void 0!==n&&n.length),N=h.isContainer,{hoverKey:I,activeKey:M,basePaddingLeft:B,showMatchedNodeOnly:D,fixedActionsFor:R,collapsible:P,collapsedNodes:F,nodeKey:T,clickFactory:O,mouseEnterFactory:j,mouseLeaveFactory:z,contextMenuFactory:_,onNodeToggle:K,getCollapsedId:W,skipNotify:$}=(0,u.o)(),{allow:H,allowDragToRoot:U,onDragStart:Y,dragElement:V,dragOverElement:q,dragStatus:G}=m(),{actions:J,actionsHidden:Q,onActionClick:X}=(0,p.l)(),Z=b*E+B-2,ee=(0,l.useContext)(L),[ne,oe]=(0,l.useState)(null),[te,ae]=(0,l.useState)(!1),[le,re]=(0,l.useState)(null!==(o=null==F?void 0:F.includes(null==W?void 0:W(h)))&&void 0!==o&&o),ie=(0,l.useMemo)((()=>null==j?void 0:j(h)),[j,h]),ce=(0,l.useMemo)((()=>null==z?void 0:z(h)),[z,h]),se=(0,l.useCallback)((e=>{var n;e.stopPropagation(),null==_||null===(n=_(h))||void 0===n||n(e)}),[_,h]),de=M&&h.key===M,ue=(0,l.useMemo)((()=>de?e=>{var n;null==e||null===(n=e.scrollIntoView)||void 0===n||n.call(e,{block:"center",inline:"center"})}:null),[]),pe=(0,l.useMemo)((()=>{return N?h.key:h.data?"mount-point"===(e=h.data).type?e.parent[T]||"".concat(e.parent.$$uid,":").concat(e.mountPoint):e[T]||e.$$uid:void 0;var e}),[T,h,N]);(0,l.useEffect)((()=>{G!==f.inside&&[f.top,f.bottom].includes(G)&&oe(G)}),[G]);var fe=(0,l.useMemo)((()=>!!V&&V.dataset.uid===String(pe)),[V,pe]),he=(0,l.useMemo)((()=>!!q&&q.dataset.uid===String(pe)),[q,pe]),me=(0,l.useMemo)((()=>{var e={opacity:fe?.2:1};return he&&G===f.inside&&(e={boxShadow:C,background:"rgba(255, 255, 255, 0.1)"}),Object.assign({},e)}),[he,fe,G]),be=(0,l.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),ae(!0),re((e=>!e))}),[]),ve=(0,l.useCallback)((e=>{e.preventDefault(),e.stopPropagation()}),[]),ge=(0,l.useCallback)((e=>{var n;if(!N)return null==O||null===(n=O(h))||void 0===n?void 0:n();be(e)}),[O,be,N,h]);(0,l.useEffect)((()=>{te&&(null==K||K(null==W?void 0:W(h),le))}),[te,le,W,h,K]);var xe=P&&!k&&!ee;return ee&&D&&!h.matched?null:r().createElement(r().Fragment,null,he&&(U||1!==b)&&ne===f.top&&r().createElement(A,{style:{marginLeft:Z}}),r().createElement("li",(0,t.A)({draggable:H,onDragStart:e=>Y(e,h),"data-uid":pe,"data-level":b,style:me},N?{"data-container":N}:{}),r().createElement(y,(0,t.A)({className:"nodeLabelLink",tabIndex:0,onMouseEnter:ie,onMouseLeave:ce,onContextMenu:se,onClick:ge},$?{url:{pathname:(0,i.get)(h.link,"url","href"),state:{notify:!1}}}:(0,a.A)({},(0,i.pick)(h.link,["url","href"]))),r().createElement("span",{className:d()("nodeLabelRow",{active:de,hover:I&&h.key===I,matched:ee&&h.matchedSelf&&!D,fixedActions:R&&[].concat(R).some((e=>(0,i.isMatch)(h.data,e))),collapsed:xe&&le,collapsible:xe})},r().createElement("span",{className:d()("nodeLabel",{unreachable:h.unreachable}),style:{paddingLeft:Z,color:h.labelColor},ref:ue},r().createElement("span",{className:"nodeIconWrapper"},xe&&r().createElement("span",{className:"collapseIcon",onClick:be,onMouseDown:ve,title:le?"Expand":"Collapse",role:"button"},r().createElement(w,{lib:"antd",theme:"outlined",icon:le?"right":"down"})),r().createElement("span",{className:"nodeIcon"},r().createElement(w,(0,t.A)({},h.icon,{style:{fontSize:null!==(c=h.icon)&&void 0!==c&&c.imgSrc?14:null,color:null===(s=h.icon)||void 0===s?void 0:s.color}})))),r().createElement("span",{className:"nodeName"},h.labelPrefix&&r().createElement("span",{style:h.labelPrefix.style},h.labelPrefix.text),h.name)),r().createElement(x,{className:"nodeActionsBar",data:h.data,isFirst:v,isLast:g,actions:J,onActionClick:X,actionsHidden:Q}),h.badge&&r().createElement("span",{className:"badge"},r().createElement(w,(0,t.A)({},h.badge,{style:{color:h.badge.color}}))))),k||r().createElement(S,{nodes:h.children,level:b+1})),he&&(U||1!==b)&&ne===f.bottom&&r().createElement(A,{style:{marginLeft:Z}}))}},9406:(e,n,o)=>{o.d(n,{N:()=>a,o:()=>l});var t=o(8769),a=(0,t.createContext)({});function l(){return(0,t.useContext)(a)}},675:(e,n,o)=>{function t(e,n){switch(typeof e){case"string":return e.toLowerCase().includes(n);case"boolean":case"number":return String(e).includes(n);case"object":return null===e?"null".includes(n):(Array.isArray(e)?e:Object.entries(e).flat()).some((e=>t(e,n)));default:return!1}}o.d(n,{U:()=>t})},6275:(e,n,o)=>{o.d(n,{A:()=>i});var t=o(6758),a=o.n(t),l=o(935),r=o.n(l)()(a());r.push([e.id,".actionsBar{display:flex;align-items:center;padding:0 3px}.action{display:flex;justify-content:center;align-items:center;width:20px;height:20px;border-radius:5px}.action:hover{color:#fff;background-color:rgba(90,93,94,0.31)}.action{color:#c5c5c5}.disabled,\n.disabled:hover{color:var(--color-disabled-text);cursor:not-allowed;background-color:initial}",""]);const i=r.toString()},7995:(e,n,o)=>{o.d(n,{A:()=>i});var t=o(6758),a=o.n(t),l=o(935),r=o.n(l)()(a());r.push([e.id,':host,\n:host-context(html[data-override-theme="light"]){--search-box-background:#fff;--node-color:#595959;--node-color-focus:#595959;--node-background-active:#e0eeff;--node-background-focus:#e0eeff;--node-icon-background-hover:#fff}:host-context(html[data-theme="dark-v2"]),\n:host-context(html[data-override-theme="dark-v2"]){--search-box-background:#181818;--node-color:#c5c5c5;--node-color-focus:#fff;--node-background-active:rgba(255,255,255,0.08);--node-background-focus:#1a7aff;--node-icon-background-hover:rgba(90,93,94,0.31)}.searchBox{position:-webkit-sticky;position:sticky;top:0;background-color:var(--search-box-background);padding:5px 10px 10px;z-index:1}.searchBox .filter-input-wrapper{background-color:var(--search-box-background);border:1px solid rgba(255,255,255,0.2);position:relative;width:100%;min-width:0;padding:2px 7px;color:var(--antd-input-color);font-size:14px;line-height:1.5715;display:inline-flex;border-radius:3px;transition:all 0.3s;box-sizing:border-box}.searchBox .filter-input-wrapper.focus{background-color:var(--search-box-background);border:1px solid rgba(255,255,255,0.2);border-right-width:1px!important;outline:0;box-shadow:0 0 0 2px rgba(0,113,235,0.2)}.searchBox .filter-input-wrapper input{text-overflow:ellipsis;border:none;outline:none;border-radius:3px;background-color:var(--search-box-background);box-sizing:border-box;margin:0;padding:0;color:var(--antd-text-color);font-variant:tabular-nums;list-style:none;font-feature-settings:"tnum";position:relative;display:inline-block;width:100%;min-width:0;color:var(--antd-input-color);font-size:14px;line-height:1.5715;background-image:none;transition:all 0.3s}.prefix{margin-right:4px}.suffix{margin-left:4px}.searchBox .prefix,\n.searchBox .suffix{display:flex;flex:none;align-items:center}.clear-button{cursor:pointer}.tree{list-style:none;margin:0;padding:0}.placeholder{color:var(--antd-input-placeholder-color);padding:0 15px}.nodeLabelLink{display:block}.nodeLabelLink::part(link){display:flex}.nodeLabelRow{display:flex;cursor:pointer;height:22px;padding-right:10px;flex:1;min-width:0}.nodeLabelRow:hover,\n.nodeLabelRow.hover{background-color:rgba(255,255,255,0.12)}.nodeLabelLink:focus .nodeLabelRow.active{background-color:var(--node-background-focus)}.nodeLabel{display:flex;align-items:center;min-width:0;flex:1}.unreachable{opacity:0.3}.nodeAction,\n.nodeAction:hover,\n.nodeLabelRow .nodeLabel{color:var(--node-color)}.nodeLabelLink:focus .nodeLabel{color:var(--node-color-focus)}.nodeLabelRow.matched .nodeLabel{color:var(--palette-orange-6)}.nodeLabelRow.active{background-color:var(--node-background-active)}.nodeIconWrapper{display:flex;width:24px;flex-shrink:0}.nodeIcon,\n.collapseIcon{display:flex;justify-content:center;align-items:center;width:20px;height:20px;border-radius:5px;font-size:13px}.collapseIcon{display:none}.nodeLabelRow.collapsed .nodeIcon,\n.nodeLabelRow.collapsible .nodeIconWrapper:hover .nodeIcon{display:none}.nodeLabelRow.collapsed .collapseIcon,\n.nodeLabelRow.collapsible .nodeIconWrapper:hover .collapseIcon{display:flex}.nodeLabelRow.collapsible .nodeIcon:hover,\n.nodeLabelRow.collapsible .collapseIcon:hover{background-color:var(--node-icon-background-hover)}.nodeName{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.nodeLabelRow:not(:hover, .fixedActions) .nodeActionsBar{display:none}.badge{margin:0 3px}.collapsed + .tree{display:none}.hightlight{outline-width:1px;outline-style:solid;outline-offset:-1px;outline-color:#fcd93f}',""]);const i=r.toString()},9575:(e,n,o)=>{function t(){return t=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var o=arguments[n];for(var t in o)Object.prototype.hasOwnProperty.call(o,t)&&(e[t]=o[t])}return e},t.apply(this,arguments)}o.d(n,{A:()=>t})}}]);
2
+ //# sourceMappingURL=2980.86396d3b.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"chunks/2980.17f0a298.js","mappings":"iLAYaA,GAA0BC,EAAAA,EAAAA,eACrC,CAAC,GAGI,SAASC,IACd,OAAOC,EAAAA,EAAAA,YAAWH,EACpB,C,wICfYI,EAAc,SAAdA,GAAc,OAAdA,EAAc,gBAAdA,EAAc,UAAdA,EAAc,gBAAdA,CAAc,MAoBbC,GAA0BJ,EAAAA,EAAAA,eACrC,CAAC,GAGI,SAASK,IACd,OAAOH,EAAAA,EAAAA,YAAWE,EACpB,C,wBCnBaE,GAAqBC,EAAAA,EAAAA,WAChC,WAcK,SAASC,EAAsBC,GASa,IATZ,KACrCC,EAAI,UACJC,EAAS,IACTC,EAAG,QACHC,EAAO,OACPC,EAAM,QACNC,EAAO,cACPC,EA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KAE1DA,EAAwBtM,KAAK,CAACuM,EAAO5K,GAAI,kWACuD,KAEhG,QAAe2K,EAAwBE,U,kECLnCF,E,MAA0B,GAA4B,KAE1DA,EAAwBtM,KAAK,CAACuM,EAAO5K,GAAI,k6GAUqV,KAE9X,QAAe2K,EAAwBE,U,iBCjBxB,SAASjC,IAYtB,OAXAA,EAAWR,OAAOC,OAASD,OAAOC,OAAOyC,OAAS,SAAUnM,GAC1D,IAAK,IAAImF,EAAI,EAAGA,EAAIpE,UAAUxG,OAAQ4K,IAAK,CACzC,IAAI2F,EAAS/J,UAAUoE,GACvB,IAAK,IAAItK,KAAOiQ,EACVrB,OAAO2C,UAAUC,eAAe1D,KAAKmC,EAAQjQ,KAC/CmF,EAAOnF,GAAOiQ,EAAOjQ,GAG3B,CACA,OAAOmF,CACT,EACOiK,EAASqC,MAAMC,KAAMxL,UAC9B,C","sources":["webpack:///./src/shared/workbench/WorkbenchActionsContext.ts","webpack:///./src/shared/workbench/WorkbenchTreeDndContext.ts","webpack:///./src/shared/workbench-mini-action-bar/WorkbenchMiniActionBar.tsx","webpack:///./src/shared/workbench/WorkbenchTree.tsx","webpack:///./src/utils/normalizeTreeNodeWithPath.ts","webpack:///./src/utils/setDragImage.ts","webpack:///./src/shared/workbench/WorkbenchTreeContext.ts","webpack:///./src/utils/deepMatch.ts","webpack:///./src/shared/workbench-mini-action-bar/WorkbenchMiniActionBar.shadow.css","webpack:///./src/workbench-tree/WorkbenchTree.shadow.css","webpack:///../../node_modules/@babel/runtime/helpers/esm/extends.js"],"sourcesContent":["import { createContext, useContext } from \"react\";\nimport type {\n ActionClickDetail,\n WorkbenchTreeAction,\n} from \"../../interfaces.js\";\n\nexport interface ContextOfWorkbenchActions {\n actions?: WorkbenchTreeAction[];\n actionsHidden?: boolean;\n onActionClick?(detail: ActionClickDetail): void;\n}\n\nexport const WorkbenchActionsContext = createContext<ContextOfWorkbenchActions>(\n {}\n);\n\nexport function useWorkbenchActionsContext(): ContextOfWorkbenchActions {\n return useContext(WorkbenchActionsContext);\n}\n","import { createContext, useContext } from \"react\";\nimport { WorkbenchNodeData } from \"../../interfaces.js\";\n\nexport enum dragStatusEnum {\n inside = \"inside\",\n top = \"top\",\n bottom = \"bottom\",\n}\n\ninterface WorkbenchTreeDndContext {\n allow?: boolean;\n allowDragToRoot?: boolean;\n dragElement?: HTMLElement;\n dragOverElement?: HTMLElement;\n dragStatus?: dragStatusEnum;\n onDragStart?: (\n e: React.DragEvent<HTMLElement>,\n node: WorkbenchNodeData\n ) => void;\n onDragOver?: (e: React.DragEvent<HTMLElement>) => void;\n onDrop?: (e: React.DragEvent<HTMLElement>) => void;\n}\n\nexport const WorkbenchTreeDndContext = createContext<WorkbenchTreeDndContext>(\n {} as WorkbenchTreeDndContext\n);\n\nexport function useWorkbenchTreeDndContext(): WorkbenchTreeDndContext {\n return useContext(WorkbenchTreeDndContext);\n}\n","import React, { useCallback, useMemo } from \"react\";\nimport { wrapBrick } from \"@next-core/react-element\";\nimport classNames from \"classnames\";\nimport { checkIfByTransform } from \"@next-core/runtime\";\nimport { WorkbenchTreeAction, ActionClickDetail } from \"../../interfaces.js\";\nimport type {\n GeneralIcon,\n GeneralIconProps,\n} from \"@next-bricks/icons/general-icon\";\n\nexport const WrappedGeneralIcon = wrapBrick<GeneralIcon, GeneralIconProps>(\n \"eo-icon\"\n);\n\nexport interface WorkbenchSubActionBarProps {\n data?: unknown;\n className?: string;\n gap?: number;\n isFirst?: boolean;\n isLast?: boolean;\n actions?: WorkbenchTreeAction[];\n actionsHidden?: boolean;\n onActionClick?(detail: ActionClickDetail): void;\n}\n\nexport function WorkbenchMiniActionBar({\n data,\n className,\n gap,\n isFirst,\n isLast,\n actions,\n actionsHidden,\n onActionClick,\n}: WorkbenchSubActionBarProps): React.ReactElement {\n const enabledActions = useMemo(\n () => actions?.filter((item) => checkIfByTransform(item, data)),\n [actions, data]\n );\n\n if (actionsHidden || !enabledActions?.length) {\n return null;\n }\n\n return (\n <div className={classNames(\"actionsBar\", className)} style={{ gap }}>\n {enabledActions.map((item) => (\n <WorkbenchSubAction\n key={item.action}\n action={item}\n data={data}\n isFirst={isFirst}\n isLast={isLast}\n onActionClick={onActionClick}\n />\n ))}\n </div>\n );\n}\n\ninterface WorkbenchSubActionProps {\n action: WorkbenchTreeAction;\n data?: unknown;\n isFirst?: boolean;\n isLast?: boolean;\n onActionClick?(detail: ActionClickDetail): void;\n}\n\nfunction WorkbenchSubAction({\n action,\n data,\n isFirst,\n isLast,\n onActionClick,\n}: WorkbenchSubActionProps): React.ReactElement {\n const disabled =\n (isFirst && action.action === \"move-up\") ||\n (isLast && action.action === \"move-down\");\n\n const handleActionClick = useCallback(\n (event: React.MouseEvent) => {\n event.preventDefault();\n event.stopPropagation();\n disabled ||\n onActionClick?.({\n action: action.action,\n data: data,\n });\n },\n [action.action, data, disabled, onActionClick]\n );\n\n const preventMouseEvent = useCallback((event: React.MouseEvent) => {\n event.preventDefault();\n event.stopPropagation();\n }, []);\n\n return (\n <a\n className={classNames(\"action\", { disabled: disabled })}\n title={action.title}\n role=\"button\"\n onClick={handleActionClick}\n onContextMenu={preventMouseEvent}\n onMouseDown={preventMouseEvent}\n >\n <WrappedGeneralIcon {...action.icon} />\n </a>\n );\n}\n","import React, {\n type ChangeEvent,\n useCallback,\n useMemo,\n useState,\n type ReactElement,\n createContext,\n useContext,\n useEffect,\n} from \"react\";\n// import { Input } from \"antd\";\nimport { get, isMatch, pick } from \"lodash\";\nimport classNames from \"classnames\";\nimport { useWorkbenchTreeContext } from \"./WorkbenchTreeContext.js\";\nimport { useWorkbenchActionsContext } from \"./WorkbenchActionsContext.js\";\nimport {\n useWorkbenchTreeDndContext,\n dragStatusEnum,\n} from \"./WorkbenchTreeDndContext.js\";\nimport type { WorkbenchNodeData } from \"../../interfaces.js\";\nimport { WorkbenchMiniActionBar } from \"../workbench-mini-action-bar/WorkbenchMiniActionBar.js\";\nimport { checkIfOfComputed } from \"@next-core/runtime\";\nimport { WorkbenchTreeDndContext } from \"./WorkbenchTreeDndContext.js\";\nimport { setDragImage } from \"../../utils/setDragImage.js\";\nimport classnames from \"classnames\";\nimport {\n getNodesByPathTree,\n getNodeTreeByPath,\n} from \"../../utils/normalizeTreeNodeWithPath.js\";\nimport { wrapBrick } from \"@next-core/react-element\";\nimport type { Link, LinkProps } from \"@next-bricks/basic/link\";\nimport type {\n GeneralIcon,\n GeneralIconProps,\n} from \"@next-bricks/icons/general-icon\";\n\nexport const WrappedLink = wrapBrick<Link, LinkProps>(\"eo-link\");\nexport const WrappedGeneralIcon = wrapBrick<GeneralIcon, GeneralIconProps>(\n \"eo-icon\"\n);\n\nconst treeLevelPadding = 10;\nconst borderStyle = \"0 0 0 1px #ba6d30\";\n\nexport interface dropEmitProps {\n nodes: WorkbenchNodeData[];\n curNode: WorkbenchNodeData;\n overNode: WorkbenchNodeData;\n status: dragStatusEnum;\n}\n\nexport interface WorkbenchTreeProps {\n nodes: WorkbenchNodeData[];\n placeholder?: string;\n searchPlaceholder?: string;\n noSearch?: boolean;\n isDrag?: boolean;\n allowDrag?: boolean;\n allowDragToRoot?: boolean;\n allowDragToInside?: boolean;\n dropEmit?: (detail: dropEmitProps) => void;\n}\n\nexport interface TreeListProps {\n nodes: WorkbenchNodeData[];\n level: number;\n}\n\nconst SearchingContext = createContext(false);\n\nexport function WorkbenchTree({\n nodes: originNode,\n placeholder,\n searchPlaceholder,\n isDrag,\n noSearch,\n allowDrag,\n allowDragToRoot,\n allowDragToInside,\n dropEmit,\n}: WorkbenchTreeProps): ReactElement {\n const [q, setQ] = useState<string>(\"\");\n const [isDragging, setIsDragging] = useState<boolean>(isDrag);\n const [curNode, setCurNode] = useState<WorkbenchNodeData>();\n const [curElement, setCurElement] = useState<HTMLElement>();\n const [overNode, setOverNode] = useState<WorkbenchNodeData>();\n const [overElement, setOverElement] = useState<HTMLElement>();\n const [overStatus, setOverStatus] = useState<dragStatusEnum>();\n const [isFocus, setIsFocus] = useState<boolean>();\n const { nodeKey, onBrickDrop, contextMenuFactory, matchNode } =\n useWorkbenchTreeContext();\n const nodes = useMemo(\n () => getNodeTreeByPath(originNode?.slice() ?? [], nodeKey),\n [originNode, nodeKey]\n );\n\n const handleSearchChange = useCallback(\n (event: ChangeEvent<HTMLInputElement>) => {\n setQ(event.target.value);\n },\n []\n );\n\n const handleClearInput = () => {\n setQ(\"\");\n };\n\n const onContextMenu = useMemo(\n () => contextMenuFactory?.(),\n [contextMenuFactory]\n );\n\n const trimmedLowerQ = q?.trim().toLowerCase();\n const filteredNodes = useMemo(() => {\n if (noSearch || !trimmedLowerQ || !nodes) {\n return nodes;\n }\n const walk = (node: WorkbenchNodeData): boolean => {\n node.matchedSelf = matchNode(node, trimmedLowerQ);\n const hasMatchedChildren = node.children?.map(walk).includes(true);\n node.matched = node.matchedSelf || hasMatchedChildren;\n return node.matched;\n };\n nodes.forEach(walk);\n return nodes.slice();\n }, [noSearch, trimmedLowerQ, nodes, matchNode]);\n\n const findDragParent = (element: HTMLElement, equal = true): HTMLElement => {\n let node = element;\n while (node) {\n if (\n node.draggable &&\n (equal || node !== element) &&\n node.tagName !== \"A\"\n ) {\n return node;\n }\n node = node.parentElement;\n }\n };\n\n const findNode = (\n nodes: WorkbenchNodeData[],\n id: string,\n nodeKey: string,\n node: WorkbenchNodeData = null\n ): WorkbenchNodeData => {\n for (const item of nodes) {\n if ((item.data as Record<string, unknown>)[nodeKey] === id) {\n node = item;\n }\n if (item.children) {\n node = findNode(item.children, id, nodeKey, node);\n }\n if (node) break;\n }\n return node;\n };\n\n const getDragState = (\n e: React.DragEvent<HTMLElement>\n ): {\n element: HTMLElement;\n node: WorkbenchNodeData;\n status: dragStatusEnum;\n } => {\n const element = findDragParent(e.target as HTMLElement);\n const id = element.dataset.uid;\n if (element === curElement || id?.includes(\":\")) {\n return;\n }\n const { top, bottom } = element.getBoundingClientRect();\n let status: dragStatusEnum;\n const repair = allowDragToInside ? 5 : 10;\n if (e.clientY < top + repair) {\n status = dragStatusEnum.top;\n } else if (e.clientY > bottom - repair) {\n status = dragStatusEnum.bottom;\n } else {\n status = allowDragToInside ? dragStatusEnum.inside : overStatus;\n }\n\n return {\n element,\n node: findNode(nodes, id, nodeKey),\n status,\n };\n };\n\n const handleOnDragStart = (\n e: React.DragEvent,\n node: WorkbenchNodeData\n ): void => {\n e.stopPropagation();\n if (!allowDrag) return;\n const element = e.target as HTMLElement;\n if (element.dataset?.container) return;\n setIsDragging(true);\n setDragImage(e, element.innerText);\n setCurElement(element);\n setCurNode(node);\n };\n\n const handleOnDragOver = (e: React.DragEvent<HTMLElement>): void => {\n e.preventDefault();\n if (!isDragging) return;\n if ((e.target as HTMLElement).className === \"workbenchTree-placeholder-dom\")\n return;\n const dom = getDragState(e);\n if (dom && !curElement?.contains(dom.element)) {\n setOverElement(dom.element);\n setOverNode(dom.node);\n setOverStatus(dom.status);\n }\n };\n\n const handleOnDragEnd = (): void => {\n setCurElement(null);\n setOverElement(null);\n setOverNode(null);\n setOverStatus(null);\n setIsDragging(false);\n };\n\n const handleOnDrop = (e: React.DragEvent<HTMLElement>): void => {\n if (!isDragging) return;\n if (onBrickDrop) {\n let parentElement = overElement;\n if ([dragStatusEnum.top, dragStatusEnum.bottom].includes(overStatus)) {\n parentElement = findDragParent(parentElement, false);\n }\n onBrickDrop(e, {\n curElement,\n overElement,\n parentElement,\n overStatus,\n });\n } else {\n if (allowDragToRoot || Number(overElement.dataset.level) !== 1) {\n let realOverNode = overNode;\n const findRealNode = (\n nodes: WorkbenchNodeData[],\n key: string\n ): void => {\n for (let i = 0; i < nodes.length; i++) {\n if (nodes[i].key === key) {\n realOverNode = nodes[i];\n break;\n }\n if (nodes[i].children) {\n findRealNode(nodes[i].children, key);\n }\n }\n };\n const overUid = overElement.dataset.uid;\n findRealNode(nodes, overUid);\n const filterNodes = (\n nodes: WorkbenchNodeData[]\n ): WorkbenchNodeData[] => {\n let flag = false;\n const { container, uid } = overElement.dataset;\n const realOverKey = container ? realOverNode.originKey : uid;\n const newNodes = nodes.filter((node) => {\n if (node.children) {\n node.children = filterNodes(node.children);\n }\n if (node.key === realOverKey) flag = true;\n return node.key !== curNode.key;\n });\n if (flag) {\n newNodes.splice(\n newNodes.findIndex((item) => item.key === realOverKey) +\n (overStatus === \"bottom\" ? 1 : 0),\n 0,\n curNode\n );\n }\n return newNodes;\n };\n\n const normalizeNode = getNodesByPathTree(nodes);\n const realCurNode = curNode.isContainer\n ? normalizeNode.find((item) => item.key === curNode.originKey)\n : curNode;\n const curNodeData = realCurNode.data as Record<string, unknown>;\n curNodeData.path = realOverNode.parentPath || realOverNode.path;\n\n dropEmit({\n nodes: filterNodes(normalizeNode),\n curNode: realCurNode,\n overNode: realOverNode,\n status: overStatus,\n });\n }\n }\n handleOnDragEnd();\n };\n\n useEffect(() => {\n setIsDragging(isDrag);\n }, [isDrag]);\n\n useEffect(() => {\n window.addEventListener(\"dragend\", handleOnDragEnd);\n return () => {\n window.removeEventListener(\"dragend\", handleOnDragEnd);\n };\n }, []);\n\n return (\n <div\n style={{\n height: \"100%\",\n }}\n className=\"tree-wrapper\"\n onContextMenu={onContextMenu}\n >\n {nodes?.length ? (\n <div>\n {!noSearch && (\n <div\n className=\"searchBox\"\n onContextMenu={(e) => e.stopPropagation()}\n >\n <span\n className={classNames(\"filter-input-wrapper\", {\n focus: isFocus,\n })}\n >\n <span className=\"prefix\">\n <WrappedGeneralIcon\n icon=\"search\"\n lib=\"antd\"\n theme=\"outlined\"\n />\n </span>\n <input\n value={q}\n onChange={handleSearchChange}\n onFocus={() => setIsFocus(true)}\n onBlur={() => setIsFocus(false)}\n autoComplete=\"off\"\n placeholder={searchPlaceholder}\n />\n <span className=\"suffix\">\n {q ? (\n <WrappedGeneralIcon\n className=\"clear-button\"\n icon=\"close-circle\"\n lib=\"antd\"\n theme=\"filled\"\n onClick={handleClearInput}\n />\n ) : null}\n </span>\n </span>\n </div>\n )}\n <SearchingContext.Provider value={!!q}>\n <WorkbenchTreeDndContext.Provider\n value={{\n allow: allowDrag,\n allowDragToRoot: allowDragToRoot,\n dragElement: curElement,\n dragOverElement: overElement,\n dragStatus: overStatus,\n onDragStart: handleOnDragStart,\n }}\n >\n <div\n className={classnames({\n hightlight: isDrag,\n })}\n onDragOver={handleOnDragOver}\n onDrop={handleOnDrop}\n >\n <TreeList nodes={filteredNodes} level={1} />\n </div>\n </WorkbenchTreeDndContext.Provider>\n </SearchingContext.Provider>\n </div>\n ) : (\n <div className=\"placeholder\">{placeholder}</div>\n )}\n </div>\n );\n}\n\nfunction TreeList({ nodes, level }: TreeListProps): ReactElement {\n const lastIndex = nodes.length - 1;\n return (\n <ul className=\"tree\">\n {nodes\n .filter((item) => checkIfOfComputed(item))\n .map((node, index) => (\n <TreeNode\n key={node.key}\n node={node}\n level={level}\n isFirst={index === 0}\n isLast={index === lastIndex}\n />\n ))}\n </ul>\n );\n}\n\nfunction PlaceholderDOM({\n style,\n}: {\n style: React.CSSProperties;\n}): React.ReactElement {\n const { dragStatus } = useWorkbenchTreeDndContext();\n const styles: React.CSSProperties = {\n height: 22,\n border: \"1px dashed goldenrod\",\n opacity: dragStatus === dragStatusEnum.inside ? \"0\" : \"1\",\n ...style,\n };\n\n return <li className=\"workbenchTree-placeholder-dom\" style={styles} />;\n}\nexport interface TreeNodeProps {\n node: WorkbenchNodeData;\n level: number;\n isFirst?: boolean;\n isLast?: boolean;\n skipNotify?: boolean;\n}\n\nfunction TreeNode({\n node,\n level,\n isFirst,\n isLast,\n}: TreeNodeProps): ReactElement {\n const isLeaf = !node.children?.length;\n const isContainer = node.isContainer;\n const {\n hoverKey,\n activeKey,\n basePaddingLeft,\n showMatchedNodeOnly,\n fixedActionsFor,\n collapsible,\n collapsedNodes,\n nodeKey,\n clickFactory,\n mouseEnterFactory,\n mouseLeaveFactory,\n contextMenuFactory,\n onNodeToggle,\n getCollapsedId,\n skipNotify,\n } = useWorkbenchTreeContext();\n const {\n allow,\n allowDragToRoot,\n onDragStart,\n dragElement,\n dragOverElement,\n dragStatus,\n } = useWorkbenchTreeDndContext();\n\n const { actions, actionsHidden, onActionClick } =\n useWorkbenchActionsContext();\n\n const nodePaddingLeft = level * treeLevelPadding + basePaddingLeft - 2;\n const searching = useContext(SearchingContext);\n const [cacheDragStatus, setCacheDragStatus] = useState(null);\n const [collapseClicked, setCollapseClicked] = useState(false);\n const [collapsed, setCollapsed] = useState(\n collapsedNodes?.includes(getCollapsedId?.(node)) ?? false\n );\n\n const onMouseEnter = useMemo(\n () => mouseEnterFactory?.(node),\n [mouseEnterFactory, node]\n );\n const onMouseLeave = useMemo(\n () => mouseLeaveFactory?.(node),\n [mouseLeaveFactory, node]\n );\n\n const onContextMenu = useCallback(\n (e: React.MouseEvent) => {\n e.stopPropagation();\n contextMenuFactory?.(node)?.(e);\n },\n [contextMenuFactory, node]\n );\n\n const isActive = activeKey && node.key === activeKey;\n\n const nodeLabelCallback = useMemo(\n () =>\n isActive\n ? (element: HTMLElement) => {\n element?.scrollIntoView?.({\n block: \"center\",\n inline: \"center\",\n // behavior: \"smooth\",\n });\n }\n : null,\n // Only for initial active node.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n []\n );\n\n const nodeUid = useMemo(() => {\n if (isContainer) {\n return node.key;\n }\n if (node.data) {\n const getNodeUid = (data: Record<string, any>): number | string => {\n return data.type === \"mount-point\"\n ? data.parent[nodeKey] || `${data.parent.$$uid}:${data.mountPoint}`\n : data[nodeKey] || data.$$uid;\n };\n return getNodeUid(node.data);\n }\n }, [nodeKey, node, isContainer]);\n\n useEffect(() => {\n if (dragStatus === dragStatusEnum.inside) {\n return;\n }\n if ([dragStatusEnum.top, dragStatusEnum.bottom].includes(dragStatus)) {\n setCacheDragStatus(dragStatus);\n }\n }, [dragStatus]);\n\n const isDragElement = useMemo(() => {\n if (dragElement) {\n const dragUid = dragElement.dataset.uid;\n return dragUid === String(nodeUid);\n }\n return false;\n }, [dragElement, nodeUid]);\n\n const isDragActive = useMemo(() => {\n if (dragOverElement) {\n const dragUid = dragOverElement.dataset.uid;\n return dragUid === String(nodeUid);\n }\n return false;\n }, [dragOverElement, nodeUid]);\n\n const nodeStyle = useMemo((): React.CSSProperties => {\n const commomStyle: React.CSSProperties = {};\n let style: React.CSSProperties = {\n opacity: isDragElement ? 0.2 : 1,\n };\n if (isDragActive) {\n if (dragStatus === dragStatusEnum.inside) {\n style = {\n boxShadow: borderStyle,\n background: \"rgba(255, 255, 255, 0.1)\",\n };\n }\n }\n return Object.assign(commomStyle, style);\n }, [isDragActive, isDragElement, dragStatus]);\n\n const handleCollapse = useCallback((event: React.MouseEvent | MouseEvent) => {\n event.preventDefault();\n event.stopPropagation();\n setCollapseClicked(true);\n setCollapsed((prev) => !prev);\n }, []);\n\n const preventMouseEvent = useCallback((event: React.MouseEvent) => {\n event.preventDefault();\n event.stopPropagation();\n }, []);\n\n const onLinkClick = useCallback(\n (e: MouseEvent | React.MouseEvent) => {\n if (isContainer) {\n handleCollapse(e);\n } else {\n return clickFactory?.(node)?.();\n }\n },\n [clickFactory, handleCollapse, isContainer, node]\n );\n\n useEffect(() => {\n if (collapseClicked) {\n onNodeToggle?.(getCollapsedId?.(node), collapsed);\n }\n }, [collapseClicked, collapsed, getCollapsedId, node, onNodeToggle]);\n\n // Disallow collapse leaf nodes, or any nodes when searching.\n const allowCollapse = collapsible && !isLeaf && !searching;\n\n if (searching && showMatchedNodeOnly && !node.matched) {\n return null;\n }\n\n return (\n <>\n {isDragActive &&\n (allowDragToRoot || level !== 1) &&\n cacheDragStatus === dragStatusEnum.top && (\n <PlaceholderDOM\n style={{\n marginLeft: nodePaddingLeft,\n }}\n />\n )}\n <li\n draggable={allow}\n onDragStart={(e) => onDragStart(e, node)}\n data-uid={nodeUid}\n data-level={level}\n style={nodeStyle}\n {...(isContainer\n ? {\n \"data-container\": isContainer,\n }\n : {})}\n >\n <WrappedLink\n className=\"nodeLabelLink\"\n tabIndex={0}\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n onContextMenu={onContextMenu}\n // noEmptyHref={true}\n onClick={onLinkClick}\n {...(skipNotify\n ? {\n // TODO: link should support\n url: {\n pathname: get(node.link, \"url\", \"href\"),\n state: {\n notify: false,\n },\n } as any,\n }\n : { ...pick(node.link, [\"url\", \"href\"]) })}\n >\n <span\n className={classNames(\"nodeLabelRow\", {\n active: isActive,\n hover: hoverKey && node.key === hoverKey,\n matched: searching && node.matchedSelf && !showMatchedNodeOnly,\n fixedActions:\n fixedActionsFor &&\n []\n .concat(fixedActionsFor)\n .some((source) =>\n isMatch(node.data as Record<string, unknown>, source)\n ),\n collapsed: allowCollapse && collapsed,\n collapsible: allowCollapse,\n })}\n >\n <span\n className={classNames(\"nodeLabel\", {\n unreachable: node.unreachable,\n })}\n style={{\n paddingLeft: nodePaddingLeft,\n color: node.labelColor,\n }}\n ref={nodeLabelCallback}\n >\n <span className=\"nodeIconWrapper\">\n {allowCollapse && (\n <span\n className=\"collapseIcon\"\n onClick={handleCollapse}\n onMouseDown={preventMouseEvent}\n title={collapsed ? \"Expand\" : \"Collapse\"}\n role=\"button\"\n >\n <WrappedGeneralIcon\n lib=\"antd\"\n theme=\"outlined\"\n icon={collapsed ? \"right\" : \"down\"}\n />\n </span>\n )}\n <span className=\"nodeIcon\">\n <WrappedGeneralIcon\n {...node.icon}\n style={{\n fontSize: (node.icon as unknown as Record<string, string>)\n ?.imgSrc\n ? 14\n : null,\n color: node.icon?.color,\n }}\n />\n </span>\n </span>\n <span className=\"nodeName\">\n {node.labelPrefix && (\n <span style={node.labelPrefix.style}>\n {node.labelPrefix.text}\n </span>\n )}\n {/* {isTransformName\n ? smartDisplayForEvaluableString(node.name)\n : node.name} */}\n {node.name}\n </span>\n </span>\n <WorkbenchMiniActionBar\n className=\"nodeActionsBar\"\n data={node.data}\n isFirst={isFirst}\n isLast={isLast}\n actions={actions}\n onActionClick={onActionClick}\n actionsHidden={actionsHidden}\n />\n {node.badge && (\n <span className=\"badge\">\n <WrappedGeneralIcon\n {...node.badge}\n style={{ color: node.badge.color }}\n />\n </span>\n )}\n </span>\n </WrappedLink>\n {isLeaf || <TreeList nodes={node.children} level={level + 1} />}\n </li>\n {isDragActive &&\n (allowDragToRoot || level !== 1) &&\n cacheDragStatus === dragStatusEnum.bottom && (\n <PlaceholderDOM\n style={{\n marginLeft: nodePaddingLeft,\n }}\n />\n )}\n </>\n );\n}\n","import _ from \"lodash\";\nimport { WorkbenchNodeData } from \"../interfaces.js\";\n\nexport function getNodeTreeByPath(\n nodes: WorkbenchNodeData[],\n nodeKey: string\n): Array<WorkbenchNodeData> {\n const createNodeByPath = (\n pathList: string[],\n nodes: Array<WorkbenchNodeData>,\n node: WorkbenchNodeData,\n index?: number\n ): void => {\n const path = pathList.shift();\n if (path) {\n pathList.length > 0\n ? pathList.splice(0, 1, `${path}/${pathList[0]}`)\n : pathList;\n const folder = nodes.find(\n (node) => node && node.key === path && node.isContainer\n );\n if (folder) {\n nodes[index] = null;\n createNodeByPath(pathList, folder.children, node);\n } else {\n const newPathList = path.split(\"/\");\n const newNode = {\n name: newPathList.pop(),\n key: path,\n parentPath: newPathList ? newPathList.join(\"/\") : newPathList,\n originKey: node.key,\n data: {\n [nodeKey]: path,\n isContainer: true,\n },\n children: [],\n icon: {\n icon: \"folder\",\n lib: \"antd\",\n theme: \"filled\",\n color: \"orange\",\n },\n isContainer: true,\n } as WorkbenchNodeData;\n if (typeof index === \"number\") {\n nodes[index] = newNode;\n } else {\n nodes.push(newNode);\n }\n createNodeByPath(pathList, newNode.children, node);\n }\n } else {\n nodes.push(node);\n }\n };\n\n nodes.forEach((node, index) => {\n if (node.path) {\n const pathList = node.path.split(\"/\").filter(Boolean);\n createNodeByPath(pathList, nodes, node, index);\n }\n });\n return nodes.filter(Boolean);\n}\n\nexport function getNodesByPathTree(\n nodes: Array<WorkbenchNodeData>\n): Array<WorkbenchNodeData> {\n const result: Array<WorkbenchNodeData> = [];\n const walk = (nodes: Array<WorkbenchNodeData>): void => {\n nodes.forEach((item) => {\n if (item.isContainer) {\n walk(item.children);\n } else {\n result.push(_.omit(item, [\"path\", \"icon\"]) as WorkbenchNodeData);\n }\n });\n };\n walk(nodes);\n return result;\n}\n","export function setDragImage(\n e: DragEvent | React.DragEvent,\n title: string\n): void {\n const canvas = document.createElement(\"canvas\");\n document.body.append(canvas);\n const context = canvas.getContext(\"2d\");\n canvas.width = context.measureText(title).width + 60;\n canvas.height = 20;\n canvas.style.position = \"absolute\";\n canvas.style.left = \"-100%\";\n canvas.style.zIndex = \"-100\";\n\n context.fillStyle = \"#333333\";\n context.fillRect(0, 0, canvas.width, canvas.height);\n\n context.fillStyle = \"#999999\";\n context.font = \"bold 14px Arial\";\n context.fillText(title, 20, 15);\n\n e.dataTransfer.setDragImage(canvas, 0, 0);\n}\n","import { createContext, useContext } from \"react\";\nimport type { WorkbenchNodeData } from \"../../interfaces.js\";\nimport { dragStatusEnum } from \"./WorkbenchTreeDndContext.js\";\n\nexport interface dropOptions {\n curElement: HTMLElement;\n overElement: HTMLElement;\n parentElement: HTMLElement;\n overStatus: dragStatusEnum;\n}\n\nexport interface ContextOfWorkbenchTree {\n hoverKey?: string | number;\n activeKey?: string | number;\n basePaddingLeft?: number;\n showMatchedNodeOnly?: boolean;\n isTransformName?: boolean;\n fixedActionsFor?: Record<string, unknown> | Record<string, unknown>[];\n collapsible?: boolean;\n collapsedNodes?: (string | number)[];\n nodeKey?: string;\n clickFactory?(node: WorkbenchNodeData): () => void;\n mouseEnterFactory?(node: WorkbenchNodeData): () => void;\n mouseLeaveFactory?(node: WorkbenchNodeData): () => void;\n contextMenuFactory?(\n node?: WorkbenchNodeData\n ): (event: React.MouseEvent) => void;\n matchNode?(node: WorkbenchNodeData, lowerTrimmedQuery?: string): boolean;\n onNodeToggle?(nodeId: string | number, collapsed: boolean): void;\n getCollapsedId?(node: WorkbenchNodeData): string | number;\n onBrickDrop?(e: React.DragEvent<HTMLElement>, options: dropOptions): void;\n skipNotify?: boolean;\n}\n\nexport const WorkbenchTreeContext = createContext<ContextOfWorkbenchTree>({});\n\nexport function useWorkbenchTreeContext(): ContextOfWorkbenchTree {\n return useContext(WorkbenchTreeContext);\n}\n","export function deepFilter<T>(data: Array<T>, q: string): Array<T> {\n const trimmedQuery = q?.trim();\n if (!trimmedQuery) {\n return data.slice();\n }\n return data.filter((item) => deepMatch(item, trimmedQuery.toLowerCase()));\n}\n\nexport function deepMatch(data: unknown, lowerTrimmedQuery: string): boolean {\n switch (typeof data) {\n case \"string\":\n return data.toLowerCase().includes(lowerTrimmedQuery);\n case \"boolean\":\n case \"number\":\n return String(data).includes(lowerTrimmedQuery);\n case \"object\":\n return data === null\n ? \"null\".includes(lowerTrimmedQuery)\n : (Array.isArray(data) ? data : Object.entries(data).flat()).some(\n (item) => deepMatch(item, lowerTrimmedQuery)\n );\n default:\n return false;\n }\n}\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../node_modules/css-loader/dist/runtime/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.actionsBar{display:flex;align-items:center;padding:0 3px}.action{display:flex;justify-content:center;align-items:center;width:20px;height:20px;border-radius:5px}.action:hover{color:#fff;background-color:rgba(90,93,94,0.31)}.action{color:#c5c5c5}.disabled,\n.disabled:hover{color:var(--color-disabled-text);cursor:not-allowed;background-color:initial}`, \"\"]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___.toString();\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `:host,\n:host-context(html[data-override-theme=\"light\"]){--search-box-background:#fff;--node-color:#595959;--node-color-focus:#595959;--node-background-active:#e0eeff;--node-background-focus:#e0eeff;--node-icon-background-hover:#fff}:host-context(html[data-theme=\"dark-v2\"]),\n:host-context(html[data-override-theme=\"dark-v2\"]){--search-box-background:#181818;--node-color:#c5c5c5;--node-color-focus:#fff;--node-background-active:rgba(255,255,255,0.08);--node-background-focus:#1a7aff;--node-icon-background-hover:rgba(90,93,94,0.31)}.searchBox{position:-webkit-sticky;position:sticky;top:0;background-color:var(--search-box-background);padding:5px 10px 10px;z-index:1}.searchBox .filter-input-wrapper{background-color:var(--search-box-background);border:1px solid rgba(255,255,255,0.2);position:relative;width:100%;min-width:0;padding:2px 7px;color:var(--antd-input-color);font-size:14px;line-height:1.5715;display:inline-flex;border-radius:3px;transition:all 0.3s;box-sizing:border-box}.searchBox .filter-input-wrapper.focus{background-color:var(--search-box-background);border:1px solid rgba(255,255,255,0.2);border-right-width:1px!important;outline:0;box-shadow:0 0 0 2px rgba(0,113,235,0.2)}.searchBox .filter-input-wrapper input{text-overflow:ellipsis;border:none;outline:none;border-radius:3px;background-color:var(--search-box-background);box-sizing:border-box;margin:0;padding:0;color:var(--antd-text-color);font-variant:tabular-nums;list-style:none;font-feature-settings:\"tnum\";position:relative;display:inline-block;width:100%;min-width:0;color:var(--antd-input-color);font-size:14px;line-height:1.5715;background-image:none;transition:all 0.3s}.prefix{margin-right:4px}.suffix{margin-left:4px}.searchBox .prefix,\n.searchBox .suffix{display:flex;flex:none;align-items:center}.clear-button{cursor:pointer}.tree{list-style:none;margin:0;padding:0}.placeholder{color:var(--antd-input-placeholder-color);padding:0 15px}.nodeLabelLink{display:block}.nodeLabelLink::part(link){display:flex}.nodeLabelRow{display:flex;cursor:pointer;height:22px;padding-right:10px;flex:1;min-width:0}.nodeLabelRow:hover,\n.nodeLabelRow.hover{background-color:rgba(255,255,255,0.12)}.nodeLabelLink:focus .nodeLabelRow.active{background-color:var(--node-background-focus)}.nodeLabel{display:flex;align-items:center;min-width:0;flex:1}.unreachable{opacity:0.3}.nodeAction,\n.nodeAction:hover,\n.nodeLabelRow .nodeLabel{color:var(--node-color)}.nodeLabelLink:focus .nodeLabel{color:var(--node-color-focus)}.nodeLabelRow.matched .nodeLabel{color:var(--palette-orange-6)}.nodeLabelRow.active{background-color:var(--node-background-active)}.nodeIconWrapper{display:flex;width:24px;flex-shrink:0}.nodeIcon,\n.collapseIcon{display:flex;justify-content:center;align-items:center;width:20px;height:20px;border-radius:5px;font-size:13px}.collapseIcon{display:none}.nodeLabelRow.collapsed .nodeIcon,\n.nodeLabelRow.collapsible .nodeIconWrapper:hover .nodeIcon{display:none}.nodeLabelRow.collapsed .collapseIcon,\n.nodeLabelRow.collapsible .nodeIconWrapper:hover .collapseIcon{display:flex}.nodeLabelRow.collapsible .nodeIcon:hover,\n.nodeLabelRow.collapsible .collapseIcon:hover{background-color:var(--node-icon-background-hover)}.nodeName{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.nodeLabelRow:not(:hover, .fixedActions) .nodeActionsBar{display:none}.badge{margin:0 3px}.collapsed + .tree{display:none}.hightlight{outline-width:1px;outline-style:solid;outline-offset:-1px;outline-color:#fcd93f}`, \"\"]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___.toString();\n","export default function _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}"],"names":["WorkbenchActionsContext","createContext","useWorkbenchActionsContext","useContext","dragStatusEnum","WorkbenchTreeDndContext","useWorkbenchTreeDndContext","WrappedGeneralIcon","wrapBrick","WorkbenchMiniActionBar","_ref","data","className","gap","isFirst","isLast","actions","actionsHidden","onActionClick","enabledActions","useMemo","filter","item","checkIfByTransform","length","React","classNames","style","map","WorkbenchSubAction","key","action","_ref2","disabled","handleActionClick","useCallback","event","preventDefault","stopPropagation","preventMouseEvent","title","role","onClick","onContextMenu","onMouseDown","icon","WrappedLink","treeLevelPadding","borderStyle","SearchingContext","WorkbenchTree","nodes","originNode","placeholder","searchPlaceholder","isDrag","noSearch","allowDrag","allowDragToRoot","allowDragToInside","dropEmit","q","setQ","useState","isDragging","setIsDragging","curNode","setCurNode","curElement","setCurElement","overNode","setOverNode","overElement","setOverElement","overStatus","setOverStatus","isFocus","setIsFocus","nodeKey","onBrickDrop","contextMenuFactory","matchNode","useWorkbenchTreeContext","_originNode$slice","createNodeByPath","pathList","node","index","path","shift","splice","concat","folder","find","isContainer","children","newPathList","split","newNode","name","pop","parentPath","join","originKey","lib","theme","color","push","forEach","Boolean","getNodeTreeByPath","slice","handleSearchChange","target","value","trimmedLowerQ","trim","toLowerCase","filteredNodes","walk","_node$children","matchedSelf","hasMatchedChildren","includes","matched","findDragParent","element","equal","arguments","undefined","draggable","tagName","parentElement","findNode","id","handleOnDragEnd","useEffect","window","addEventListener","removeEventListener","height","e","focus","onChange","onFocus","onBlur","autoComplete","handleClearInput","Provider","allow","dragElement","dragOverElement","dragStatus","onDragStart","handleOnDragStart","_element$dataset","dataset","container","canvas","document","createElement","body","append","context","getContext","width","measureText","position","left","zIndex","fillStyle","fillRect","font","fillText","dataTransfer","setDragImage","innerText","classnames","hightlight","onDragOver","dom","uid","status","top","bottom","getBoundingClientRect","repair","clientY","inside","getDragState","contains","onDrop","Number","level","realOverNode","findRealNode","i","overUid","filterNodes","flag","realOverKey","newNodes","findIndex","normalizeNode","result","_","getNodesByPathTree","realCurNode","TreeList","lastIndex","checkIfOfComputed","TreeNode","PlaceholderDOM","_ref3","styles","_objectSpread","border","opacity","_ref4","_node$children2","_collapsedNodes$inclu","_node$icon","_node$icon2","isLeaf","hoverKey","activeKey","basePaddingLeft","showMatchedNodeOnly","fixedActionsFor","collapsible","collapsedNodes","clickFactory","mouseEnterFactory","mouseLeaveFactory","onNodeToggle","getCollapsedId","skipNotify","nodePaddingLeft","searching","cacheDragStatus","setCacheDragStatus","collapseClicked","setCollapseClicked","collapsed","setCollapsed","onMouseEnter","onMouseLeave","_contextMenuFactory","isActive","nodeLabelCallback","_element$scrollIntoVi","scrollIntoView","call","block","inline","nodeUid","type","parent","$$uid","mountPoint","isDragElement","String","isDragActive","nodeStyle","boxShadow","background","Object","assign","handleCollapse","prev","onLinkClick","_clickFactory","allowCollapse","marginLeft","_extends","tabIndex","url","pathname","get","link","state","notify","pick","active","hover","fixedActions","some","source","isMatch","unreachable","paddingLeft","labelColor","ref","fontSize","imgSrc","labelPrefix","text","badge","WorkbenchTreeContext","deepMatch","lowerTrimmedQuery","Array","isArray","entries","flat","___CSS_LOADER_EXPORT___","module","toString","bind","prototype","hasOwnProperty","apply","this"],"sourceRoot":""}
1
+ {"version":3,"file":"chunks/2980.86396d3b.js","mappings":"iLAYaA,GAA0BC,EAAAA,EAAAA,eACrC,CAAC,GAGI,SAASC,IACd,OAAOC,EAAAA,EAAAA,YAAWH,EACpB,C,wICfYI,EAAc,SAAdA,GAAc,OAAdA,EAAc,gBAAdA,EAAc,UAAdA,EAAc,gBAAdA,CAAc,MAoBbC,GAA0BJ,EAAAA,EAAAA,eACrC,CAAC,GAGI,SAASK,IACd,OAAOH,EAAAA,EAAAA,YAAWE,EACpB,C,wBCnBaE,GAAqBC,EAAAA,EAAAA,WAChC,WAcK,SAASC,EAAsBC,GASa,IATZ,KACrCC,EAAI,UACJC,EAAS,IACTC,EAAG,QACHC,EAAO,OACPC,EAAM,QACNC,EAAO,cACPC,EAAa,cACbC,GAC2BR,EACrBS,GAAiBC,EAAAA,EAAAA,UACrB,IAAMJ,aAAO,EAAPA,EAASK,QAAQC,IAASC,EAAAA,EAAAA,oBAAmBD,EAAMX,MACzD,CAACK,EAASL,IAGZ,OAAIM,GAAkBE,UAAAA,EAAgBK,OAC7B,KAIPC,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AASjC,IAYtB,OAXAA,EAAWR,OAAOC,OAASD,OAAOC,OAAOyC,OAAS,SAAUnM,GAC1D,IAAK,IAAImF,EAAI,EAAGA,EAAIpE,UAAUxG,OAAQ4K,IAAK,CACzC,IAAI2F,EAAS/J,UAAUoE,GACvB,IAAK,IAAItK,KAAOiQ,EACVrB,OAAO2C,UAAUC,eAAe1D,KAAKmC,EAAQjQ,KAC/CmF,EAAOnF,GAAOiQ,EAAOjQ,GAG3B,CACA,OAAOmF,CACT,EACOiK,EAASqC,MAAMC,KAAMxL,UAC9B,C","sources":["webpack:///./src/shared/workbench/WorkbenchActionsContext.ts","webpack:///./src/shared/workbench/WorkbenchTreeDndContext.ts","webpack:///./src/shared/workbench-mini-action-bar/WorkbenchMiniActionBar.tsx","webpack:///./src/shared/workbench/WorkbenchTree.tsx","webpack:///./src/utils/normalizeTreeNodeWithPath.ts","webpack:///./src/utils/setDragImage.ts","webpack:///./src/shared/workbench/WorkbenchTreeContext.ts","webpack:///./src/utils/deepMatch.ts","webpack:///./src/shared/workbench-mini-action-bar/WorkbenchMiniActionBar.shadow.css","webpack:///./src/workbench-tree/WorkbenchTree.shadow.css","webpack:///../../node_modules/@babel/runtime/helpers/esm/extends.js"],"sourcesContent":["import { createContext, useContext } from \"react\";\nimport type {\n ActionClickDetail,\n WorkbenchTreeAction,\n} from \"../../interfaces.js\";\n\nexport interface ContextOfWorkbenchActions {\n actions?: WorkbenchTreeAction[];\n actionsHidden?: boolean;\n onActionClick?(detail: ActionClickDetail): void;\n}\n\nexport const WorkbenchActionsContext = createContext<ContextOfWorkbenchActions>(\n {}\n);\n\nexport function useWorkbenchActionsContext(): ContextOfWorkbenchActions {\n return useContext(WorkbenchActionsContext);\n}\n","import { createContext, useContext } from \"react\";\nimport { WorkbenchNodeData } from \"../../interfaces.js\";\n\nexport enum dragStatusEnum {\n inside = \"inside\",\n top = \"top\",\n bottom = \"bottom\",\n}\n\ninterface WorkbenchTreeDndContext {\n allow?: boolean;\n allowDragToRoot?: boolean;\n dragElement?: HTMLElement;\n dragOverElement?: HTMLElement;\n dragStatus?: dragStatusEnum;\n onDragStart?: (\n e: React.DragEvent<HTMLElement>,\n node: WorkbenchNodeData\n ) => void;\n onDragOver?: (e: React.DragEvent<HTMLElement>) => void;\n onDrop?: (e: React.DragEvent<HTMLElement>) => void;\n}\n\nexport const WorkbenchTreeDndContext = createContext<WorkbenchTreeDndContext>(\n {} as WorkbenchTreeDndContext\n);\n\nexport function useWorkbenchTreeDndContext(): WorkbenchTreeDndContext {\n return useContext(WorkbenchTreeDndContext);\n}\n","import React, { useCallback, useMemo } from \"react\";\nimport { wrapBrick } from \"@next-core/react-element\";\nimport classNames from \"classnames\";\nimport { checkIfByTransform } from \"@next-core/runtime\";\nimport { WorkbenchTreeAction, ActionClickDetail } from \"../../interfaces.js\";\nimport type {\n GeneralIcon,\n GeneralIconProps,\n} from \"@next-bricks/icons/general-icon\";\n\nexport const WrappedGeneralIcon = wrapBrick<GeneralIcon, GeneralIconProps>(\n \"eo-icon\"\n);\n\nexport interface WorkbenchSubActionBarProps {\n data?: unknown;\n className?: string;\n gap?: number;\n isFirst?: boolean;\n isLast?: boolean;\n actions?: WorkbenchTreeAction[];\n actionsHidden?: boolean;\n onActionClick?(detail: ActionClickDetail): void;\n}\n\nexport function WorkbenchMiniActionBar({\n data,\n className,\n gap,\n isFirst,\n isLast,\n actions,\n actionsHidden,\n onActionClick,\n}: WorkbenchSubActionBarProps): React.ReactElement {\n const enabledActions = useMemo(\n () => actions?.filter((item) => checkIfByTransform(item, data)),\n [actions, data]\n );\n\n if (actionsHidden || !enabledActions?.length) {\n return null;\n }\n\n return (\n <div className={classNames(\"actionsBar\", className)} style={{ gap }}>\n {enabledActions.map((item) => (\n <WorkbenchSubAction\n key={item.action}\n action={item}\n data={data}\n isFirst={isFirst}\n isLast={isLast}\n onActionClick={onActionClick}\n />\n ))}\n </div>\n );\n}\n\ninterface WorkbenchSubActionProps {\n action: WorkbenchTreeAction;\n data?: unknown;\n isFirst?: boolean;\n isLast?: boolean;\n onActionClick?(detail: ActionClickDetail): void;\n}\n\nfunction WorkbenchSubAction({\n action,\n data,\n isFirst,\n isLast,\n onActionClick,\n}: WorkbenchSubActionProps): React.ReactElement {\n const disabled =\n (isFirst && action.action === \"move-up\") ||\n (isLast && action.action === \"move-down\");\n\n const handleActionClick = useCallback(\n (event: React.MouseEvent) => {\n event.preventDefault();\n event.stopPropagation();\n disabled ||\n onActionClick?.({\n action: action.action,\n data: data,\n });\n },\n [action.action, data, disabled, onActionClick]\n );\n\n const preventMouseEvent = useCallback((event: React.MouseEvent) => {\n event.preventDefault();\n event.stopPropagation();\n }, []);\n\n return (\n <a\n className={classNames(\"action\", { disabled: disabled })}\n title={action.title}\n role=\"button\"\n onClick={handleActionClick}\n onContextMenu={preventMouseEvent}\n onMouseDown={preventMouseEvent}\n >\n <WrappedGeneralIcon {...action.icon} />\n </a>\n );\n}\n","import React, {\n type ChangeEvent,\n useCallback,\n useMemo,\n useState,\n type ReactElement,\n createContext,\n useContext,\n useEffect,\n} from \"react\";\n// import { Input } from \"antd\";\nimport { get, isMatch, pick } from \"lodash\";\nimport classNames from \"classnames\";\nimport { useWorkbenchTreeContext } from \"./WorkbenchTreeContext.js\";\nimport { useWorkbenchActionsContext } from \"./WorkbenchActionsContext.js\";\nimport {\n useWorkbenchTreeDndContext,\n dragStatusEnum,\n} from \"./WorkbenchTreeDndContext.js\";\nimport type { WorkbenchNodeData } from \"../../interfaces.js\";\nimport { WorkbenchMiniActionBar } from \"../workbench-mini-action-bar/WorkbenchMiniActionBar.js\";\nimport { checkIfOfComputed } from \"@next-core/runtime\";\nimport { WorkbenchTreeDndContext } from \"./WorkbenchTreeDndContext.js\";\nimport { setDragImage } from \"../../utils/setDragImage.js\";\nimport classnames from \"classnames\";\nimport {\n getNodesByPathTree,\n getNodeTreeByPath,\n} from \"../../utils/normalizeTreeNodeWithPath.js\";\nimport { wrapBrick } from \"@next-core/react-element\";\nimport type { Link, LinkProps } from \"@next-bricks/basic/link\";\nimport type {\n GeneralIcon,\n GeneralIconProps,\n} from \"@next-bricks/icons/general-icon\";\n\nexport const WrappedLink = wrapBrick<Link, LinkProps>(\"eo-link\");\nexport const WrappedGeneralIcon = wrapBrick<GeneralIcon, GeneralIconProps>(\n \"eo-icon\"\n);\n\nconst treeLevelPadding = 10;\nconst borderStyle = \"0 0 0 1px #ba6d30\";\n\nexport interface dropEmitProps {\n nodes: WorkbenchNodeData[];\n curNode: WorkbenchNodeData;\n overNode: WorkbenchNodeData;\n status: dragStatusEnum;\n}\n\nexport interface WorkbenchTreeProps {\n nodes: WorkbenchNodeData[];\n placeholder?: string;\n searchPlaceholder?: string;\n noSearch?: boolean;\n isDrag?: boolean;\n allowDrag?: boolean;\n allowDragToRoot?: boolean;\n allowDragToInside?: boolean;\n dropEmit?: (detail: dropEmitProps) => void;\n}\n\nexport interface TreeListProps {\n nodes: WorkbenchNodeData[];\n level: number;\n}\n\nconst SearchingContext = createContext(false);\n\nexport function WorkbenchTree({\n nodes: originNode,\n placeholder,\n searchPlaceholder,\n isDrag,\n noSearch,\n allowDrag,\n allowDragToRoot,\n allowDragToInside,\n dropEmit,\n}: WorkbenchTreeProps): ReactElement {\n const [q, setQ] = useState<string>(\"\");\n const [isDragging, setIsDragging] = useState<boolean>(isDrag);\n const [curNode, setCurNode] = useState<WorkbenchNodeData>();\n const [curElement, setCurElement] = useState<HTMLElement>();\n const [overNode, setOverNode] = useState<WorkbenchNodeData>();\n const [overElement, setOverElement] = useState<HTMLElement>();\n const [overStatus, setOverStatus] = useState<dragStatusEnum>();\n const [isFocus, setIsFocus] = useState<boolean>();\n const { nodeKey, onBrickDrop, contextMenuFactory, matchNode } =\n useWorkbenchTreeContext();\n const nodes = useMemo(\n () => getNodeTreeByPath(originNode?.slice() ?? [], nodeKey),\n [originNode, nodeKey]\n );\n\n const handleSearchChange = useCallback(\n (event: ChangeEvent<HTMLInputElement>) => {\n setQ(event.target.value);\n },\n []\n );\n\n const handleClearInput = () => {\n setQ(\"\");\n };\n\n const onContextMenu = useMemo(\n () => contextMenuFactory?.(),\n [contextMenuFactory]\n );\n\n const trimmedLowerQ = q?.trim().toLowerCase();\n const filteredNodes = useMemo(() => {\n if (noSearch || !trimmedLowerQ || !nodes) {\n return nodes;\n }\n const walk = (node: WorkbenchNodeData): boolean => {\n node.matchedSelf = matchNode(node, trimmedLowerQ);\n const hasMatchedChildren = node.children?.map(walk).includes(true);\n node.matched = node.matchedSelf || hasMatchedChildren;\n return node.matched;\n };\n nodes.forEach(walk);\n return nodes.slice();\n }, [noSearch, trimmedLowerQ, nodes, matchNode]);\n\n const findDragParent = (element: HTMLElement, equal = true): HTMLElement => {\n let node = element;\n while (node) {\n if (\n node.draggable &&\n (equal || node !== element) &&\n node.tagName !== \"A\"\n ) {\n return node;\n }\n node = node.parentElement;\n }\n };\n\n const findNode = (\n nodes: WorkbenchNodeData[],\n id: string,\n nodeKey: string,\n node: WorkbenchNodeData = null\n ): WorkbenchNodeData => {\n for (const item of nodes) {\n if ((item.data as Record<string, unknown>)[nodeKey] === id) {\n node = item;\n }\n if (item.children) {\n node = findNode(item.children, id, nodeKey, node);\n }\n if (node) break;\n }\n return node;\n };\n\n const getDragState = (\n e: React.DragEvent<HTMLElement>\n ): {\n element: HTMLElement;\n node: WorkbenchNodeData;\n status: dragStatusEnum;\n } => {\n const element = findDragParent(e.target as HTMLElement);\n const id = element.dataset.uid;\n if (element === curElement || id?.includes(\":\")) {\n return;\n }\n const { top, bottom } = element.getBoundingClientRect();\n let status: dragStatusEnum;\n const repair = allowDragToInside ? 5 : 10;\n if (e.clientY < top + repair) {\n status = dragStatusEnum.top;\n } else if (e.clientY > bottom - repair) {\n status = dragStatusEnum.bottom;\n } else {\n status = allowDragToInside ? dragStatusEnum.inside : overStatus;\n }\n\n return {\n element,\n node: findNode(nodes, id, nodeKey),\n status,\n };\n };\n\n const handleOnDragStart = (\n e: React.DragEvent,\n node: WorkbenchNodeData\n ): void => {\n e.stopPropagation();\n if (!allowDrag) return;\n const element = e.target as HTMLElement;\n if (element.dataset?.container) return;\n setIsDragging(true);\n setDragImage(e, element.innerText);\n setCurElement(element);\n setCurNode(node);\n };\n\n const handleOnDragOver = (e: React.DragEvent<HTMLElement>): void => {\n e.preventDefault();\n if (!isDragging) return;\n if ((e.target as HTMLElement).className === \"workbenchTree-placeholder-dom\")\n return;\n const dom = getDragState(e);\n if (dom && !curElement?.contains(dom.element)) {\n setOverElement(dom.element);\n setOverNode(dom.node);\n setOverStatus(dom.status);\n }\n };\n\n const handleOnDragEnd = (): void => {\n setCurElement(null);\n setOverElement(null);\n setOverNode(null);\n setOverStatus(null);\n setIsDragging(false);\n };\n\n const handleOnDrop = (e: React.DragEvent<HTMLElement>): void => {\n if (!isDragging) return;\n if (onBrickDrop) {\n let parentElement = overElement;\n if ([dragStatusEnum.top, dragStatusEnum.bottom].includes(overStatus)) {\n parentElement = findDragParent(parentElement, false);\n }\n onBrickDrop(e, {\n curElement,\n overElement,\n parentElement,\n overStatus,\n });\n } else {\n if (allowDragToRoot || Number(overElement.dataset.level) !== 1) {\n let realOverNode = overNode;\n const findRealNode = (\n nodes: WorkbenchNodeData[],\n key: string\n ): void => {\n for (let i = 0; i < nodes.length; i++) {\n if (nodes[i].key === key) {\n realOverNode = nodes[i];\n break;\n }\n if (nodes[i].children) {\n findRealNode(nodes[i].children, key);\n }\n }\n };\n const overUid = overElement.dataset.uid;\n findRealNode(nodes, overUid);\n const filterNodes = (\n nodes: WorkbenchNodeData[]\n ): WorkbenchNodeData[] => {\n let flag = false;\n const { container, uid } = overElement.dataset;\n const realOverKey = container ? realOverNode.originKey : uid;\n const newNodes = nodes.filter((node) => {\n if (node.children) {\n node.children = filterNodes(node.children);\n }\n if (node.key === realOverKey) flag = true;\n return node.key !== curNode.key;\n });\n if (flag) {\n newNodes.splice(\n newNodes.findIndex((item) => item.key === realOverKey) +\n (overStatus === \"bottom\" ? 1 : 0),\n 0,\n curNode\n );\n }\n return newNodes;\n };\n\n const normalizeNode = getNodesByPathTree(nodes);\n const realCurNode = curNode.isContainer\n ? normalizeNode.find((item) => item.key === curNode.originKey)\n : curNode;\n const curNodeData = realCurNode.data as Record<string, unknown>;\n curNodeData.path = realOverNode.parentPath || realOverNode.path;\n\n dropEmit({\n nodes: filterNodes(normalizeNode),\n curNode: realCurNode,\n overNode: realOverNode,\n status: overStatus,\n });\n }\n }\n handleOnDragEnd();\n };\n\n useEffect(() => {\n setIsDragging(isDrag);\n }, [isDrag]);\n\n useEffect(() => {\n window.addEventListener(\"dragend\", handleOnDragEnd);\n return () => {\n window.removeEventListener(\"dragend\", handleOnDragEnd);\n };\n }, []);\n\n return (\n <div\n style={{\n height: \"100%\",\n }}\n className=\"tree-wrapper\"\n onContextMenu={onContextMenu}\n >\n {nodes?.length ? (\n <div>\n {!noSearch && (\n <div\n className=\"searchBox\"\n onContextMenu={(e) => e.stopPropagation()}\n >\n <span\n className={classNames(\"filter-input-wrapper\", {\n focus: isFocus,\n })}\n >\n <span className=\"prefix\">\n <WrappedGeneralIcon\n icon=\"search\"\n lib=\"antd\"\n theme=\"outlined\"\n />\n </span>\n <input\n value={q}\n onChange={handleSearchChange}\n onFocus={() => setIsFocus(true)}\n onBlur={() => setIsFocus(false)}\n autoComplete=\"off\"\n placeholder={searchPlaceholder}\n />\n <span className=\"suffix\">\n {q ? (\n <WrappedGeneralIcon\n className=\"clear-button\"\n icon=\"close-circle\"\n lib=\"antd\"\n theme=\"filled\"\n onClick={handleClearInput}\n />\n ) : null}\n </span>\n </span>\n </div>\n )}\n <SearchingContext.Provider value={!!q}>\n <WorkbenchTreeDndContext.Provider\n value={{\n allow: allowDrag,\n allowDragToRoot: allowDragToRoot,\n dragElement: curElement,\n dragOverElement: overElement,\n dragStatus: overStatus,\n onDragStart: handleOnDragStart,\n }}\n >\n <div\n className={classnames({\n hightlight: isDrag,\n })}\n onDragOver={handleOnDragOver}\n onDrop={handleOnDrop}\n >\n <TreeList nodes={filteredNodes} level={1} />\n </div>\n </WorkbenchTreeDndContext.Provider>\n </SearchingContext.Provider>\n </div>\n ) : (\n <div className=\"placeholder\">{placeholder}</div>\n )}\n </div>\n );\n}\n\nfunction TreeList({ nodes, level }: TreeListProps): ReactElement {\n const lastIndex = nodes.length - 1;\n return (\n <ul className=\"tree\">\n {nodes\n .filter((item) => checkIfOfComputed(item))\n .map((node, index) => (\n <TreeNode\n key={node.key}\n node={node}\n level={level}\n isFirst={index === 0}\n isLast={index === lastIndex}\n />\n ))}\n </ul>\n );\n}\n\nfunction PlaceholderDOM({\n style,\n}: {\n style: React.CSSProperties;\n}): React.ReactElement {\n const { dragStatus } = useWorkbenchTreeDndContext();\n const styles: React.CSSProperties = {\n height: 22,\n border: \"1px dashed goldenrod\",\n opacity: dragStatus === dragStatusEnum.inside ? \"0\" : \"1\",\n ...style,\n };\n\n return <li className=\"workbenchTree-placeholder-dom\" style={styles} />;\n}\nexport interface TreeNodeProps {\n node: WorkbenchNodeData;\n level: number;\n isFirst?: boolean;\n isLast?: boolean;\n skipNotify?: boolean;\n}\n\nfunction TreeNode({\n node,\n level,\n isFirst,\n isLast,\n}: TreeNodeProps): ReactElement {\n const isLeaf = !node.children?.length;\n const isContainer = node.isContainer;\n const {\n hoverKey,\n activeKey,\n basePaddingLeft,\n showMatchedNodeOnly,\n fixedActionsFor,\n collapsible,\n collapsedNodes,\n nodeKey,\n clickFactory,\n mouseEnterFactory,\n mouseLeaveFactory,\n contextMenuFactory,\n onNodeToggle,\n getCollapsedId,\n skipNotify,\n } = useWorkbenchTreeContext();\n const {\n allow,\n allowDragToRoot,\n onDragStart,\n dragElement,\n dragOverElement,\n dragStatus,\n } = useWorkbenchTreeDndContext();\n\n const { actions, actionsHidden, onActionClick } =\n useWorkbenchActionsContext();\n\n const nodePaddingLeft = level * treeLevelPadding + basePaddingLeft - 2;\n const searching = useContext(SearchingContext);\n const [cacheDragStatus, setCacheDragStatus] = useState(null);\n const [collapseClicked, setCollapseClicked] = useState(false);\n const [collapsed, setCollapsed] = useState(\n collapsedNodes?.includes(getCollapsedId?.(node)) ?? false\n );\n\n const onMouseEnter = useMemo(\n () => mouseEnterFactory?.(node),\n [mouseEnterFactory, node]\n );\n const onMouseLeave = useMemo(\n () => mouseLeaveFactory?.(node),\n [mouseLeaveFactory, node]\n );\n\n const onContextMenu = useCallback(\n (e: React.MouseEvent) => {\n e.stopPropagation();\n contextMenuFactory?.(node)?.(e);\n },\n [contextMenuFactory, node]\n );\n\n const isActive = activeKey && node.key === activeKey;\n\n const nodeLabelCallback = useMemo(\n () =>\n isActive\n ? (element: HTMLElement) => {\n element?.scrollIntoView?.({\n block: \"center\",\n inline: \"center\",\n // behavior: \"smooth\",\n });\n }\n : null,\n // Only for initial active node.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n []\n );\n\n const nodeUid = useMemo(() => {\n if (isContainer) {\n return node.key;\n }\n if (node.data) {\n const getNodeUid = (data: Record<string, any>): number | string => {\n return data.type === \"mount-point\"\n ? data.parent[nodeKey] || `${data.parent.$$uid}:${data.mountPoint}`\n : data[nodeKey] || data.$$uid;\n };\n return getNodeUid(node.data);\n }\n }, [nodeKey, node, isContainer]);\n\n useEffect(() => {\n if (dragStatus === dragStatusEnum.inside) {\n return;\n }\n if ([dragStatusEnum.top, dragStatusEnum.bottom].includes(dragStatus)) {\n setCacheDragStatus(dragStatus);\n }\n }, [dragStatus]);\n\n const isDragElement = useMemo(() => {\n if (dragElement) {\n const dragUid = dragElement.dataset.uid;\n return dragUid === String(nodeUid);\n }\n return false;\n }, [dragElement, nodeUid]);\n\n const isDragActive = useMemo(() => {\n if (dragOverElement) {\n const dragUid = dragOverElement.dataset.uid;\n return dragUid === String(nodeUid);\n }\n return false;\n }, [dragOverElement, nodeUid]);\n\n const nodeStyle = useMemo((): React.CSSProperties => {\n const commomStyle: React.CSSProperties = {};\n let style: React.CSSProperties = {\n opacity: isDragElement ? 0.2 : 1,\n };\n if (isDragActive) {\n if (dragStatus === dragStatusEnum.inside) {\n style = {\n boxShadow: borderStyle,\n background: \"rgba(255, 255, 255, 0.1)\",\n };\n }\n }\n return Object.assign(commomStyle, style);\n }, [isDragActive, isDragElement, dragStatus]);\n\n const handleCollapse = useCallback((event: React.MouseEvent | MouseEvent) => {\n event.preventDefault();\n event.stopPropagation();\n setCollapseClicked(true);\n setCollapsed((prev) => !prev);\n }, []);\n\n const preventMouseEvent = useCallback((event: React.MouseEvent) => {\n event.preventDefault();\n event.stopPropagation();\n }, []);\n\n const onLinkClick = useCallback(\n (e: MouseEvent | React.MouseEvent) => {\n if (isContainer) {\n handleCollapse(e);\n } else {\n return clickFactory?.(node)?.();\n }\n },\n [clickFactory, handleCollapse, isContainer, node]\n );\n\n useEffect(() => {\n if (collapseClicked) {\n onNodeToggle?.(getCollapsedId?.(node), collapsed);\n }\n }, [collapseClicked, collapsed, getCollapsedId, node, onNodeToggle]);\n\n // Disallow collapse leaf nodes, or any nodes when searching.\n const allowCollapse = collapsible && !isLeaf && !searching;\n\n if (searching && showMatchedNodeOnly && !node.matched) {\n return null;\n }\n\n return (\n <>\n {isDragActive &&\n (allowDragToRoot || level !== 1) &&\n cacheDragStatus === dragStatusEnum.top && (\n <PlaceholderDOM\n style={{\n marginLeft: nodePaddingLeft,\n }}\n />\n )}\n <li\n draggable={allow}\n onDragStart={(e) => onDragStart(e, node)}\n data-uid={nodeUid}\n data-level={level}\n style={nodeStyle}\n {...(isContainer\n ? {\n \"data-container\": isContainer,\n }\n : {})}\n >\n <WrappedLink\n className=\"nodeLabelLink\"\n tabIndex={0}\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n onContextMenu={onContextMenu}\n // noEmptyHref={true}\n onClick={onLinkClick}\n {...(skipNotify\n ? {\n // TODO: link should support\n url: {\n pathname: get(node.link, \"url\", \"href\"),\n state: {\n notify: false,\n },\n } as any,\n }\n : { ...pick(node.link, [\"url\", \"href\"]) })}\n >\n <span\n className={classNames(\"nodeLabelRow\", {\n active: isActive,\n hover: hoverKey && node.key === hoverKey,\n matched: searching && node.matchedSelf && !showMatchedNodeOnly,\n fixedActions:\n fixedActionsFor &&\n []\n .concat(fixedActionsFor)\n .some((source) =>\n isMatch(node.data as Record<string, unknown>, source)\n ),\n collapsed: allowCollapse && collapsed,\n collapsible: allowCollapse,\n })}\n >\n <span\n className={classNames(\"nodeLabel\", {\n unreachable: node.unreachable,\n })}\n style={{\n paddingLeft: nodePaddingLeft,\n color: node.labelColor,\n }}\n ref={nodeLabelCallback}\n >\n <span className=\"nodeIconWrapper\">\n {allowCollapse && (\n <span\n className=\"collapseIcon\"\n onClick={handleCollapse}\n onMouseDown={preventMouseEvent}\n title={collapsed ? \"Expand\" : \"Collapse\"}\n role=\"button\"\n >\n <WrappedGeneralIcon\n lib=\"antd\"\n theme=\"outlined\"\n icon={collapsed ? \"right\" : \"down\"}\n />\n </span>\n )}\n <span className=\"nodeIcon\">\n <WrappedGeneralIcon\n {...node.icon}\n style={{\n fontSize: (node.icon as unknown as Record<string, string>)\n ?.imgSrc\n ? 14\n : null,\n color: node.icon?.color,\n }}\n />\n </span>\n </span>\n <span className=\"nodeName\">\n {node.labelPrefix && (\n <span style={node.labelPrefix.style}>\n {node.labelPrefix.text}\n </span>\n )}\n {/* {isTransformName\n ? smartDisplayForEvaluableString(node.name)\n : node.name} */}\n {node.name}\n </span>\n </span>\n <WorkbenchMiniActionBar\n className=\"nodeActionsBar\"\n data={node.data}\n isFirst={isFirst}\n isLast={isLast}\n actions={actions}\n onActionClick={onActionClick}\n actionsHidden={actionsHidden}\n />\n {node.badge && (\n <span className=\"badge\">\n <WrappedGeneralIcon\n {...node.badge}\n style={{ color: node.badge.color }}\n />\n </span>\n )}\n </span>\n </WrappedLink>\n {isLeaf || <TreeList nodes={node.children} level={level + 1} />}\n </li>\n {isDragActive &&\n (allowDragToRoot || level !== 1) &&\n cacheDragStatus === dragStatusEnum.bottom && (\n <PlaceholderDOM\n style={{\n marginLeft: nodePaddingLeft,\n }}\n />\n )}\n </>\n );\n}\n","import _ from \"lodash\";\nimport { WorkbenchNodeData } from \"../interfaces.js\";\n\nexport function getNodeTreeByPath(\n nodes: WorkbenchNodeData[],\n nodeKey: string\n): Array<WorkbenchNodeData> {\n const createNodeByPath = (\n pathList: string[],\n nodes: Array<WorkbenchNodeData>,\n node: WorkbenchNodeData,\n index?: number\n ): void => {\n const path = pathList.shift();\n if (path) {\n pathList.length > 0\n ? pathList.splice(0, 1, `${path}/${pathList[0]}`)\n : pathList;\n const folder = nodes.find(\n (node) => node && node.key === path && node.isContainer\n );\n if (folder) {\n nodes[index] = null;\n createNodeByPath(pathList, folder.children, node);\n } else {\n const newPathList = path.split(\"/\");\n const newNode = {\n name: newPathList.pop(),\n key: path,\n parentPath: newPathList ? newPathList.join(\"/\") : newPathList,\n originKey: node.key,\n data: {\n [nodeKey]: path,\n isContainer: true,\n },\n children: [],\n icon: {\n icon: \"folder\",\n lib: \"antd\",\n theme: \"filled\",\n color: \"orange\",\n },\n isContainer: true,\n } as WorkbenchNodeData;\n if (typeof index === \"number\") {\n nodes[index] = newNode;\n } else {\n nodes.push(newNode);\n }\n createNodeByPath(pathList, newNode.children, node);\n }\n } else {\n nodes.push(node);\n }\n };\n\n nodes.forEach((node, index) => {\n if (node.path) {\n const pathList = node.path.split(\"/\").filter(Boolean);\n createNodeByPath(pathList, nodes, node, index);\n }\n });\n return nodes.filter(Boolean);\n}\n\nexport function getNodesByPathTree(\n nodes: Array<WorkbenchNodeData>\n): Array<WorkbenchNodeData> {\n const result: Array<WorkbenchNodeData> = [];\n const walk = (nodes: Array<WorkbenchNodeData>): void => {\n nodes.forEach((item) => {\n if (item.isContainer) {\n walk(item.children);\n } else {\n result.push(_.omit(item, [\"path\", \"icon\"]) as WorkbenchNodeData);\n }\n });\n };\n walk(nodes);\n return result;\n}\n","export function setDragImage(\n e: DragEvent | React.DragEvent,\n title: string\n): void {\n const canvas = document.createElement(\"canvas\");\n document.body.append(canvas);\n const context = canvas.getContext(\"2d\");\n canvas.width = context.measureText(title).width + 60;\n canvas.height = 20;\n canvas.style.position = \"absolute\";\n canvas.style.left = \"-100%\";\n canvas.style.zIndex = \"-100\";\n\n context.fillStyle = \"#333333\";\n context.fillRect(0, 0, canvas.width, canvas.height);\n\n context.fillStyle = \"#999999\";\n context.font = \"bold 14px Arial\";\n context.fillText(title, 20, 15);\n\n e.dataTransfer.setDragImage(canvas, 0, 0);\n}\n","import { createContext, useContext } from \"react\";\nimport type { WorkbenchNodeData } from \"../../interfaces.js\";\nimport { dragStatusEnum } from \"./WorkbenchTreeDndContext.js\";\n\nexport interface dropOptions {\n curElement: HTMLElement;\n overElement: HTMLElement;\n parentElement: HTMLElement;\n overStatus: dragStatusEnum;\n}\n\nexport interface ContextOfWorkbenchTree {\n hoverKey?: string | number;\n activeKey?: string | number;\n basePaddingLeft?: number;\n showMatchedNodeOnly?: boolean;\n isTransformName?: boolean;\n fixedActionsFor?: Record<string, unknown> | Record<string, unknown>[];\n collapsible?: boolean;\n collapsedNodes?: (string | number)[];\n nodeKey?: string;\n clickFactory?(node: WorkbenchNodeData): () => void;\n mouseEnterFactory?(node: WorkbenchNodeData): () => void;\n mouseLeaveFactory?(node: WorkbenchNodeData): () => void;\n contextMenuFactory?(\n node?: WorkbenchNodeData\n ): (event: React.MouseEvent) => void;\n matchNode?(node: WorkbenchNodeData, lowerTrimmedQuery?: string): boolean;\n onNodeToggle?(nodeId: string | number, collapsed: boolean): void;\n getCollapsedId?(node: WorkbenchNodeData): string | number;\n onBrickDrop?(e: React.DragEvent<HTMLElement>, options: dropOptions): void;\n skipNotify?: boolean;\n}\n\nexport const WorkbenchTreeContext = createContext<ContextOfWorkbenchTree>({});\n\nexport function useWorkbenchTreeContext(): ContextOfWorkbenchTree {\n return useContext(WorkbenchTreeContext);\n}\n","export function deepFilter<T>(data: Array<T>, q: string): Array<T> {\n const trimmedQuery = q?.trim();\n if (!trimmedQuery) {\n return data.slice();\n }\n return data.filter((item) => deepMatch(item, trimmedQuery.toLowerCase()));\n}\n\nexport function deepMatch(data: unknown, lowerTrimmedQuery: string): boolean {\n switch (typeof data) {\n case \"string\":\n return data.toLowerCase().includes(lowerTrimmedQuery);\n case \"boolean\":\n case \"number\":\n return String(data).includes(lowerTrimmedQuery);\n case \"object\":\n return data === null\n ? \"null\".includes(lowerTrimmedQuery)\n : (Array.isArray(data) ? data : Object.entries(data).flat()).some(\n (item) => deepMatch(item, lowerTrimmedQuery)\n );\n default:\n return false;\n }\n}\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../node_modules/css-loader/dist/runtime/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.actionsBar{display:flex;align-items:center;padding:0 3px}.action{display:flex;justify-content:center;align-items:center;width:20px;height:20px;border-radius:5px}.action:hover{color:#fff;background-color:rgba(90,93,94,0.31)}.action{color:#c5c5c5}.disabled,\n.disabled:hover{color:var(--color-disabled-text);cursor:not-allowed;background-color:initial}`, \"\"]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___.toString();\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `:host,\n:host-context(html[data-override-theme=\"light\"]){--search-box-background:#fff;--node-color:#595959;--node-color-focus:#595959;--node-background-active:#e0eeff;--node-background-focus:#e0eeff;--node-icon-background-hover:#fff}:host-context(html[data-theme=\"dark-v2\"]),\n:host-context(html[data-override-theme=\"dark-v2\"]){--search-box-background:#181818;--node-color:#c5c5c5;--node-color-focus:#fff;--node-background-active:rgba(255,255,255,0.08);--node-background-focus:#1a7aff;--node-icon-background-hover:rgba(90,93,94,0.31)}.searchBox{position:-webkit-sticky;position:sticky;top:0;background-color:var(--search-box-background);padding:5px 10px 10px;z-index:1}.searchBox .filter-input-wrapper{background-color:var(--search-box-background);border:1px solid rgba(255,255,255,0.2);position:relative;width:100%;min-width:0;padding:2px 7px;color:var(--antd-input-color);font-size:14px;line-height:1.5715;display:inline-flex;border-radius:3px;transition:all 0.3s;box-sizing:border-box}.searchBox .filter-input-wrapper.focus{background-color:var(--search-box-background);border:1px solid rgba(255,255,255,0.2);border-right-width:1px!important;outline:0;box-shadow:0 0 0 2px rgba(0,113,235,0.2)}.searchBox .filter-input-wrapper input{text-overflow:ellipsis;border:none;outline:none;border-radius:3px;background-color:var(--search-box-background);box-sizing:border-box;margin:0;padding:0;color:var(--antd-text-color);font-variant:tabular-nums;list-style:none;font-feature-settings:\"tnum\";position:relative;display:inline-block;width:100%;min-width:0;color:var(--antd-input-color);font-size:14px;line-height:1.5715;background-image:none;transition:all 0.3s}.prefix{margin-right:4px}.suffix{margin-left:4px}.searchBox .prefix,\n.searchBox .suffix{display:flex;flex:none;align-items:center}.clear-button{cursor:pointer}.tree{list-style:none;margin:0;padding:0}.placeholder{color:var(--antd-input-placeholder-color);padding:0 15px}.nodeLabelLink{display:block}.nodeLabelLink::part(link){display:flex}.nodeLabelRow{display:flex;cursor:pointer;height:22px;padding-right:10px;flex:1;min-width:0}.nodeLabelRow:hover,\n.nodeLabelRow.hover{background-color:rgba(255,255,255,0.12)}.nodeLabelLink:focus .nodeLabelRow.active{background-color:var(--node-background-focus)}.nodeLabel{display:flex;align-items:center;min-width:0;flex:1}.unreachable{opacity:0.3}.nodeAction,\n.nodeAction:hover,\n.nodeLabelRow .nodeLabel{color:var(--node-color)}.nodeLabelLink:focus .nodeLabel{color:var(--node-color-focus)}.nodeLabelRow.matched .nodeLabel{color:var(--palette-orange-6)}.nodeLabelRow.active{background-color:var(--node-background-active)}.nodeIconWrapper{display:flex;width:24px;flex-shrink:0}.nodeIcon,\n.collapseIcon{display:flex;justify-content:center;align-items:center;width:20px;height:20px;border-radius:5px;font-size:13px}.collapseIcon{display:none}.nodeLabelRow.collapsed .nodeIcon,\n.nodeLabelRow.collapsible .nodeIconWrapper:hover .nodeIcon{display:none}.nodeLabelRow.collapsed .collapseIcon,\n.nodeLabelRow.collapsible .nodeIconWrapper:hover .collapseIcon{display:flex}.nodeLabelRow.collapsible .nodeIcon:hover,\n.nodeLabelRow.collapsible .collapseIcon:hover{background-color:var(--node-icon-background-hover)}.nodeName{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.nodeLabelRow:not(:hover, .fixedActions) .nodeActionsBar{display:none}.badge{margin:0 3px}.collapsed + .tree{display:none}.hightlight{outline-width:1px;outline-style:solid;outline-offset:-1px;outline-color:#fcd93f}`, \"\"]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___.toString();\n","export default function _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}"],"names":["WorkbenchActionsContext","createContext","useWorkbenchActionsContext","useContext","dragStatusEnum","WorkbenchTreeDndContext","useWorkbenchTreeDndContext","WrappedGeneralIcon","wrapBrick","WorkbenchMiniActionBar","_ref","data","className","gap","isFirst","isLast","actions","actionsHidden","onActionClick","enabledActions","useMemo","filter","item","checkIfByTransform","length","React","classNames","style","map","WorkbenchSubAction","key","action","_ref2","disabled","handleActionClick","useCallback","event","preventDefault","stopPropagation","preventMouseEvent","title","role","onClick","onContextMenu","onMouseDown","icon","WrappedLink","treeLevelPadding","borderStyle","SearchingContext","WorkbenchTree","nodes","originNode","placeholder","searchPlaceholder","isDrag","noSearch","allowDrag","allowDragToRoot","allowDragToInside","dropEmit","q","setQ","useState","isDragging","setIsDragging","curNode","setCurNode","curElement","setCurElement","overNode","setOverNode","overElement","setOverElement","overStatus","setOverStatus","isFocus","setIsFocus","nodeKey","onBrickDrop","contextMenuFactory","matchNode","useWorkbenchTreeContext","_originNode$slice","createNodeByPath","pathList","node","index","path","shift","splice","concat","folder","find","isContainer","children","newPathList","split","newNode","name","pop","parentPath","join","originKey","lib","theme","color","push","forEach","Boolean","getNodeTreeByPath","slice","handleSearchChange","target","value","trimmedLowerQ","trim","toLowerCase","filteredNodes","walk","_node$children","matchedSelf","hasMatchedChildren","includes","matched","findDragParent","element","equal","arguments","undefined","draggable","tagName","parentElement","findNode","id","handleOnDragEnd","useEffect","window","addEventListener","removeEventListener","height","e","focus","onChange","onFocus","onBlur","autoComplete","handleClearInput","Provider","allow","dragElement","dragOverElement","dragStatus","onDragStart","handleOnDragStart","_element$dataset","dataset","container","canvas","document","createElement","body","append","context","getContext","width","measureText","position","left","zIndex","fillStyle","fillRect","font","fillText","dataTransfer","setDragImage","innerText","classnames","hightlight","onDragOver","dom","uid","status","top","bottom","getBoundingClientRect","repair","clientY","inside","getDragState","contains","onDrop","Number","level","realOverNode","findRealNode","i","overUid","filterNodes","flag","realOverKey","newNodes","findIndex","normalizeNode","result","_","getNodesByPathTree","realCurNode","TreeList","lastIndex","checkIfOfComputed","TreeNode","PlaceholderDOM","_ref3","styles","_objectSpread","border","opacity","_ref4","_node$children2","_collapsedNodes$inclu","_node$icon","_node$icon2","isLeaf","hoverKey","activeKey","basePaddingLeft","showMatchedNodeOnly","fixedActionsFor","collapsible","collapsedNodes","clickFactory","mouseEnterFactory","mouseLeaveFactory","onNodeToggle","getCollapsedId","skipNotify","nodePaddingLeft","searching","cacheDragStatus","setCacheDragStatus","collapseClicked","setCollapseClicked","collapsed","setCollapsed","onMouseEnter","onMouseLeave","_contextMenuFactory","isActive","nodeLabelCallback","_element$scrollIntoVi","scrollIntoView","call","block","inline","nodeUid","type","parent","$$uid","mountPoint","isDragElement","String","isDragActive","nodeStyle","boxShadow","background","Object","assign","handleCollapse","prev","onLinkClick","_clickFactory","allowCollapse","marginLeft","_extends","tabIndex","url","pathname","get","link","state","notify","pick","active","hover","fixedActions","some","source","isMatch","unreachable","paddingLeft","labelColor","ref","fontSize","imgSrc","labelPrefix","text","badge","WorkbenchTreeContext","deepMatch","lowerTrimmedQuery","Array","isArray","entries","flat","___CSS_LOADER_EXPORT___","module","toString","bind","prototype","hasOwnProperty","apply","this"],"sourceRoot":""}
@@ -1,2 +1,2 @@
1
- "use strict";(self.webpackChunk_next_bricks_visual_builder=self.webpackChunk_next_bricks_visual_builder||[]).push([[3171,5552,790],{5552:(e,i,n)=>{n.r(i),n.d(i,{i18n:()=>f,i18nText:()=>c,initializeI18n:()=>l});var r=n(2350),t=n(8799),a=n(7072),s=!1,u=new Set;function l(e,i){if(s||(s=!0,t.i18n.use(a.default).init({fallbackLng:"zh",debug:!1,supportedLngs:["zh","en"],nonExplicitSupportedLngs:!0,interpolation:{escapeValue:!1},react:{useSuspense:!1},compatibilityJSON:"v3",resources:{}})),e&&i&&!u.has(e))for(var[n,r]of(u.add(e),Object.entries(i)))t.i18n.addResourceBundle(n,e,r)}var o=n(8594);function c(e){var i;if(e){var n=null!==(i=t.i18n.language)&&void 0!==i?i:"zh-CN";if((0,o.hasOwnProperty)(e,n))return e[n];var r=n.split("-")[0];if(r!==n)return(0,o.hasOwnProperty)(e,r)?e[r]:void 0;var a="".concat(r,"-");for(var s of Object.keys(e))if(s.startsWith(a))return e[s]}}var f=r.default}}]);
2
- //# sourceMappingURL=3171.e940cbee.js.map
1
+ "use strict";(self.webpackChunk_next_bricks_visual_builder=self.webpackChunk_next_bricks_visual_builder||[]).push([[3171,5552,790],{5552:(e,i,n)=>{n.r(i),n.d(i,{i18n:()=>f,i18nText:()=>c,initializeI18n:()=>l});var r=n(2350),t=n(8799),a=n(7072),s=!1,u=new Set;function l(e,i){if(s||(s=!0,t.i18n.use(a.default).init({fallbackLng:"zh",debug:!1,supportedLngs:["zh","en"],nonExplicitSupportedLngs:!0,interpolation:{escapeValue:!1},react:{useSuspense:!1},compatibilityJSON:"v3",resources:{}})),e&&i&&!u.has(e))for(var[n,r]of(u.add(e),Object.entries(i)))t.i18n.addResourceBundle(n,e,r)}var o=n(9387);function c(e){var i;if(e){var n=null!==(i=t.i18n.language)&&void 0!==i?i:"zh-CN";if((0,o.hasOwnProperty)(e,n))return e[n];var r=n.split("-")[0];if(r!==n)return(0,o.hasOwnProperty)(e,r)?e[r]:void 0;var a="".concat(r,"-");for(var s of Object.keys(e))if(s.startsWith(a))return e[s]}}var f=r.default}}]);
2
+ //# sourceMappingURL=3171.b08430df.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"chunks/3171.e940cbee.js","mappings":"oPAEIA,GAAc,EACdC,EAAwB,IAAIC,IACzB,SAASC,EAAeC,EAAIC,GAwBjC,GAvBKL,IACHA,GAAc,EACd,EAAAM,KAICC,IAAmF,WAEnFC,KAAK,CACJC,YAAa,KACbC,OAAO,EACPC,cAAe,CAAC,KAAM,MACtBC,0BAA0B,EAC1BC,cAAe,CACbC,aAAa,GAEfC,MAAO,CACLC,aAAa,GAEfC,kBAAmB,KACnBC,UAAW,CAAC,KAGXd,GAAOC,IAAWJ,EAAsBkB,IAAIf,GAIjD,IAAK,IAAKgB,EAAMF,KADhBjB,EAAsBoB,IAAIjB,GACIkB,OAAOC,QAAQlB,IAC3C,EAAAC,KAAKkB,kBAAkBJ,EAAMhB,EAAIc,EAErC,C,cCjCO,SAASO,EAASC,GACvB,IAAIC,EACJ,GAAKD,EAAL,CAGA,IAAIE,EAAgD,QAApCD,EAAiB,EAAArB,KAAKsB,gBAAyC,IAAnBD,EAA4BA,EAAiB,QAEzG,IAAI,IAAAE,gBAAeH,EAAME,GACvB,OAAOF,EAAKE,GAGd,IAAIE,EAAkBF,EAASG,MAAM,KAAK,GAC1C,GAAID,IAAoBF,EAGtB,OAAO,IAAAC,gBAAeH,EAAMI,GAAmBJ,EAAKI,QAAmBE,EAKzE,IAAIC,EAAS,GAAGC,OAAOJ,EAAiB,KACxC,IAAK,IAAIK,KAAOb,OAAOc,KAAKV,GAC1B,GAAIS,EAAIE,WAAWJ,GACjB,OAAOP,EAAKS,EAnBhB,CAsBF,CC3BO,IAAI7B,EAA6E,S","sources":["webpack:///../../node_modules/@next-core/i18n/dist/esm/init.js","webpack:///../../node_modules/@next-core/i18n/dist/esm/text.js","webpack:///../../node_modules/@next-core/i18n/dist/esm/index.js"],"sourcesContent":["import { i18n } from \"@next-core/i18n\";\nimport LanguageDetector from \"i18next-browser-languagedetector\";\nvar initialized = false;\nvar initializedNamespaces = new Set();\nexport function initializeI18n(NS, locales) {\n if (!initialized) {\n initialized = true;\n i18n\n // learn more: https://github.com/i18next/i18next-xhr-backend\n // .use(Backend)\n // learn more: https://github.com/i18next/i18next-browser-languageDetector\n .use(process.env.NODE_ENV === \"test\" ? LanguageDetector : /* istanbul ignore next */LanguageDetector.default)\n // for all options read: https://www.i18next.com/overview/configuration-options\n .init({\n fallbackLng: \"zh\",\n debug: process.env.NODE_ENV === \"development\",\n supportedLngs: [\"zh\", \"en\"],\n nonExplicitSupportedLngs: true,\n interpolation: {\n escapeValue: false // not needed for react as it escapes by default\n },\n react: {\n useSuspense: false\n },\n compatibilityJSON: \"v3\",\n resources: {}\n });\n }\n if (!NS || !locales || initializedNamespaces.has(NS)) {\n return;\n }\n initializedNamespaces.add(NS);\n for (var [lang, resources] of Object.entries(locales)) {\n i18n.addResourceBundle(lang, NS, resources);\n }\n}\n//# sourceMappingURL=init.js.map","import { i18n } from \"@next-core/i18n\";\nimport { hasOwnProperty } from \"@next-core/utils/general\";\nexport function i18nText(data) {\n var _i18n$language;\n if (!data) {\n return;\n }\n var language = (_i18n$language = i18n.language) !== null && _i18n$language !== void 0 ? _i18n$language : \"zh-CN\";\n // First, make a perfect match.\n if (hasOwnProperty(data, language)) {\n return data[language];\n }\n // https://en.wikipedia.org/wiki/IETF_language_tag\n var primaryLanguage = language.split(\"-\")[0];\n if (primaryLanguage !== language) {\n // Then, match the primary language (which omits other subtags).\n // E.g., match `zh` if the current language is `zh-CN`.\n return hasOwnProperty(data, primaryLanguage) ? data[primaryLanguage] : undefined;\n }\n // At last, match the first key which starts with the primary language,\n // if the current language contains primary subtag only.\n // E.g., match `zh-CN` if the current language is `zh`.\n var prefix = \"\".concat(primaryLanguage, \"-\");\n for (var key of Object.keys(data)) {\n if (key.startsWith(prefix)) {\n return data[key];\n }\n }\n}\n//# sourceMappingURL=text.js.map","import i18next from \"i18next\";\nexport var i18n = process.env.NODE_ENV === \"test\" ? i18next : /* istanbul ignore next */i18next.default;\nexport * from \"./init.js\";\nexport * from \"./text.js\";\n//# sourceMappingURL=index.js.map"],"names":["initialized","initializedNamespaces","Set","initializeI18n","NS","locales","i18n","use","init","fallbackLng","debug","supportedLngs","nonExplicitSupportedLngs","interpolation","escapeValue","react","useSuspense","compatibilityJSON","resources","has","lang","add","Object","entries","addResourceBundle","i18nText","data","_i18n$language","language","hasOwnProperty","primaryLanguage","split","undefined","prefix","concat","key","keys","startsWith"],"sourceRoot":""}
1
+ {"version":3,"file":"chunks/3171.b08430df.js","mappings":"oPAEIA,GAAc,EACdC,EAAwB,IAAIC,IACzB,SAASC,EAAeC,EAAIC,GAwBjC,GAvBKL,IACHA,GAAc,EACd,EAAAM,KAICC,IAAmF,WAEnFC,KAAK,CACJC,YAAa,KACbC,OAAO,EACPC,cAAe,CAAC,KAAM,MACtBC,0BAA0B,EAC1BC,cAAe,CACbC,aAAa,GAEfC,MAAO,CACLC,aAAa,GAEfC,kBAAmB,KACnBC,UAAW,CAAC,KAGXd,GAAOC,IAAWJ,EAAsBkB,IAAIf,GAIjD,IAAK,IAAKgB,EAAMF,KADhBjB,EAAsBoB,IAAIjB,GACIkB,OAAOC,QAAQlB,IAC3C,EAAAC,KAAKkB,kBAAkBJ,EAAMhB,EAAIc,EAErC,C,cCjCO,SAASO,EAASC,GACvB,IAAIC,EACJ,GAAKD,EAAL,CAGA,IAAIE,EAAgD,QAApCD,EAAiB,EAAArB,KAAKsB,gBAAyC,IAAnBD,EAA4BA,EAAiB,QAEzG,IAAI,IAAAE,gBAAeH,EAAME,GACvB,OAAOF,EAAKE,GAGd,IAAIE,EAAkBF,EAASG,MAAM,KAAK,GAC1C,GAAID,IAAoBF,EAGtB,OAAO,IAAAC,gBAAeH,EAAMI,GAAmBJ,EAAKI,QAAmBE,EAKzE,IAAIC,EAAS,GAAGC,OAAOJ,EAAiB,KACxC,IAAK,IAAIK,KAAOb,OAAOc,KAAKV,GAC1B,GAAIS,EAAIE,WAAWJ,GACjB,OAAOP,EAAKS,EAnBhB,CAsBF,CC3BO,IAAI7B,EAA6E,S","sources":["webpack:///../../node_modules/@next-core/i18n/dist/esm/init.js","webpack:///../../node_modules/@next-core/i18n/dist/esm/text.js","webpack:///../../node_modules/@next-core/i18n/dist/esm/index.js"],"sourcesContent":["import { i18n } from \"@next-core/i18n\";\nimport LanguageDetector from \"i18next-browser-languagedetector\";\nvar initialized = false;\nvar initializedNamespaces = new Set();\nexport function initializeI18n(NS, locales) {\n if (!initialized) {\n initialized = true;\n i18n\n // learn more: https://github.com/i18next/i18next-xhr-backend\n // .use(Backend)\n // learn more: https://github.com/i18next/i18next-browser-languageDetector\n .use(process.env.NODE_ENV === \"test\" ? LanguageDetector : /* istanbul ignore next */LanguageDetector.default)\n // for all options read: https://www.i18next.com/overview/configuration-options\n .init({\n fallbackLng: \"zh\",\n debug: process.env.NODE_ENV === \"development\",\n supportedLngs: [\"zh\", \"en\"],\n nonExplicitSupportedLngs: true,\n interpolation: {\n escapeValue: false // not needed for react as it escapes by default\n },\n react: {\n useSuspense: false\n },\n compatibilityJSON: \"v3\",\n resources: {}\n });\n }\n if (!NS || !locales || initializedNamespaces.has(NS)) {\n return;\n }\n initializedNamespaces.add(NS);\n for (var [lang, resources] of Object.entries(locales)) {\n i18n.addResourceBundle(lang, NS, resources);\n }\n}\n//# sourceMappingURL=init.js.map","import { i18n } from \"@next-core/i18n\";\nimport { hasOwnProperty } from \"@next-core/utils/general\";\nexport function i18nText(data) {\n var _i18n$language;\n if (!data) {\n return;\n }\n var language = (_i18n$language = i18n.language) !== null && _i18n$language !== void 0 ? _i18n$language : \"zh-CN\";\n // First, make a perfect match.\n if (hasOwnProperty(data, language)) {\n return data[language];\n }\n // https://en.wikipedia.org/wiki/IETF_language_tag\n var primaryLanguage = language.split(\"-\")[0];\n if (primaryLanguage !== language) {\n // Then, match the primary language (which omits other subtags).\n // E.g., match `zh` if the current language is `zh-CN`.\n return hasOwnProperty(data, primaryLanguage) ? data[primaryLanguage] : undefined;\n }\n // At last, match the first key which starts with the primary language,\n // if the current language contains primary subtag only.\n // E.g., match `zh-CN` if the current language is `zh`.\n var prefix = \"\".concat(primaryLanguage, \"-\");\n for (var key of Object.keys(data)) {\n if (key.startsWith(prefix)) {\n return data[key];\n }\n }\n}\n//# sourceMappingURL=text.js.map","import i18next from \"i18next\";\nexport var i18n = process.env.NODE_ENV === \"test\" ? i18next : /* istanbul ignore next */i18next.default;\nexport * from \"./init.js\";\nexport * from \"./text.js\";\n//# sourceMappingURL=index.js.map"],"names":["initialized","initializedNamespaces","Set","initializeI18n","NS","locales","i18n","use","init","fallbackLng","debug","supportedLngs","nonExplicitSupportedLngs","interpolation","escapeValue","react","useSuspense","compatibilityJSON","resources","has","lang","add","Object","entries","addResourceBundle","i18nText","data","_i18n$language","language","hasOwnProperty","primaryLanguage","split","undefined","prefix","concat","key","keys","startsWith"],"sourceRoot":""}
@@ -1,2 +1,2 @@
1
- "use strict";(self.webpackChunk_next_bricks_visual_builder=self.webpackChunk_next_bricks_visual_builder||[]).push([[3933,6314],{3933:(e,t,r)=>{function o(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return function(n,a){if("string"==typeof t?n.name===t:t.includes(n.name)){for(var i=[],s=1;s<=r;s++){var c=a[a.length-s];if("MemberExpression"===(null==c?void 0:c.node.type)&&"object"===c.key){var u=c.node;u.computed||"Identifier"!==u.property.type?u.computed&&"Literal"===u.property.type&&"string"==typeof u.property.value?i.push(o?"".concat(n.name,".").concat(u.property.value):u.property.value):e.hasNonStaticUsage=!0:i.push(o?"".concat(n.name,".").concat(u.property.name):u.property.name)}else e.hasNonStaticUsage=!0}i.length===r&&e.usedProperties.add(i.join("."))}}}function n(e,t){return function(r,o,n){if(o.name===e){var a=n[n.length-1],i=n[n.length-2];if("CallExpression"===(null==i?void 0:i.node.type)&&"callee"===(null==i?void 0:i.key)&&"MemberExpression"===(null==a?void 0:a.node.type)&&"object"===a.key&&(a.node.computed?"Literal"===a.node.property.type&&a.node.property.value===t:"Identifier"===a.node.property.type&&a.node.property.name===t)){var s=i.node.arguments;if(s.length>0){var c=s[0];"Literal"===c.type&&"string"==typeof c.value?r.usedArgs.add(c.value):r.hasNonStaticUsage=!0}}}}}r.r(t),r.d(t,{beforeVisitGlobalMember:()=>o,collectAppGetMenuUsage:()=>a,collectInstalledAppsHasUsage:()=>i,collectMemberUsage:()=>p,collectMemberUsageInFunction:()=>g,createProviderClass:()=>c.createProviderClass,scanPermissionActionsInAny:()=>m,scanPermissionActionsInStoryboard:()=>b,strictCollectMemberUsage:()=>l,track:()=>d,trackAll:()=>f,traverseStoryboardExpressions:()=>u,traverseStoryboardFunction:()=>v,traverseStoryboardFunctions:()=>y,unwrapProvider:()=>c.unwrapProvider});var a=n("APP","getMenu"),i=n("INSTALLED_APPS","has"),s=r(7068),c=r(8594);function u(e,t,r){var o=new WeakSet,{matchExpressionString:n,visitNotMatchedExpressionString:a,visitNonExpressionString:i,visitObject:u}="string"==typeof r?{matchExpressionString:e=>e.includes(r)}:r;!function e(r){if("string"==typeof r)if((0,s.isEvaluable)(r))if(n(r))try{(0,s.preevaluate)(r,{withParent:!0,hooks:{beforeVisitGlobal(e,o){t(e,o,r)}}})}catch(e){console.error("Parse storyboard expression failed:",e)}else null==a||a(r);else null==i||i(r);else if((0,c.isObject)(r)){if(o.has(r))return;for(var l of(o.add(r),null==u||u(r),Array.isArray(r)?r:Object.values(r)))e(l)}}(e)}function l(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,{hasNonStaticUsage:o,nonStaticUsage:n,usedProperties:a}=p(e,t,r);if(o)throw new Error("Non-static usage of ".concat(t,' is prohibited, check your expression: "').concat(n,'"'));return a}function p(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n={usedProperties:new Set,hasNonStaticUsage:!1},a=o(n,t,r);return u(e,((e,t,r)=>{a(e,t),n.hasNonStaticUsage&&(n.nonStaticUsage=r)}),t),n}function d(e,t,r){if(e.includes(t)){var n,a={usedProperties:new Set,hasNonStaticUsage:!1},{expression:i}=(0,s.preevaluate)(e,{withParent:!0,hooks:{beforeVisitGlobal:o(a,r)}});if("SequenceExpression"===i.type&&(n=i.expressions[0])&&"Literal"===n.type&&n.value===t){if(a.usedProperties.size>0)return a.usedProperties;console.warn('You are using "'.concat(t,'" but no `').concat(r,"` usage found in your expression: ").concat(JSON.stringify(e)))}}return!1}function f(e){if(e){var t={usedProperties:new Set,hasNonStaticUsage:!1};if((0,s.preevaluate)(e,{withParent:!0,hooks:{beforeVisitGlobal:o(t,["CTX","STATE","FORM_STATE"],1,!0)}}),t.usedProperties.size>0){var r=[...t.usedProperties],n={context:!1,state:!1,formState:!1},a={CTX:"context",STATE:"state",FORM_STATE:"formState"};return r.forEach((e=>{var[t,r]=e.split(".");n[a[t]]||(n[a[t]]=[]),n[a[t]].push(r)})),n}console.warn('You are using track all but no "CTX" or "STATE" or "FORM_STATE" usage found in your expression: '.concat(JSON.stringify(e)))}return!1}function y(e,t){if(Array.isArray(e))for(var r of e)v(r,t)}function v(e,t,r){try{(0,s.precookFunction)(e.source,{typescript:e.typescript,withParent:!0,hooks:{beforeVisitGlobal:t}})}catch(t){r||console.error('Parse storyboard function "'.concat(e.name,'" failed:'),t)}}function g(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,a={usedProperties:new Set,hasNonStaticUsage:!1};if(v(e,o(a,t,n),r),a.hasNonStaticUsage&&!r)throw new Error("Non-static usage of ".concat(t,' is prohibited, check your function: "').concat(e.name,'"'));return a.usedProperties.delete(e.name),a.usedProperties}var h="PERMISSIONS",S="check";function b(e){var t,r=new Set,o=P(r),{customTemplates:n,functions:a}=null!==(t=e.meta)&&void 0!==t?t:{};return u([e.routes,n],o,h),y(a,o),Array.from(r)}function m(e){var t=new Set;return u(e,P(t),h),Array.from(t)}function P(e){return function(t,r){if(t.name===h){var o=r[r.length-1],n=r[r.length-2];if("CallExpression"===(null==n?void 0:n.node.type)&&"callee"===(null==n?void 0:n.key)&&"MemberExpression"===(null==o?void 0:o.node.type)&&"object"===o.key&&(o.node.computed?"Literal"===o.node.property.type&&o.node.property.value===S:"Identifier"===o.node.property.type&&o.node.property.name===S))for(var a of n.node.arguments)"Literal"===a.type&&"string"==typeof a.value&&e.add(a.value)}}}}}]);
2
- //# sourceMappingURL=3933.ebc8e8f2.js.map
1
+ "use strict";(self.webpackChunk_next_bricks_visual_builder=self.webpackChunk_next_bricks_visual_builder||[]).push([[3933,6314],{3933:(e,t,r)=>{function o(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return function(n,a){if("string"==typeof t?n.name===t:t.includes(n.name)){for(var i=[],s=1;s<=r;s++){var c=a[a.length-s];if("MemberExpression"===(null==c?void 0:c.node.type)&&"object"===c.key){var u=c.node;u.computed||"Identifier"!==u.property.type?u.computed&&"Literal"===u.property.type&&"string"==typeof u.property.value?i.push(o?"".concat(n.name,".").concat(u.property.value):u.property.value):e.hasNonStaticUsage=!0:i.push(o?"".concat(n.name,".").concat(u.property.name):u.property.name)}else e.hasNonStaticUsage=!0}i.length===r&&e.usedProperties.add(i.join("."))}}}function n(e,t){return function(r,o,n){if(o.name===e){var a=n[n.length-1],i=n[n.length-2];if("CallExpression"===(null==i?void 0:i.node.type)&&"callee"===(null==i?void 0:i.key)&&"MemberExpression"===(null==a?void 0:a.node.type)&&"object"===a.key&&(a.node.computed?"Literal"===a.node.property.type&&a.node.property.value===t:"Identifier"===a.node.property.type&&a.node.property.name===t)){var s=i.node.arguments;if(s.length>0){var c=s[0];"Literal"===c.type&&"string"==typeof c.value?r.usedArgs.add(c.value):r.hasNonStaticUsage=!0}}}}}r.r(t),r.d(t,{beforeVisitGlobalMember:()=>o,collectAppGetMenuUsage:()=>a,collectInstalledAppsHasUsage:()=>i,collectMemberUsage:()=>p,collectMemberUsageInFunction:()=>g,createProviderClass:()=>c.createProviderClass,scanPermissionActionsInAny:()=>m,scanPermissionActionsInStoryboard:()=>b,strictCollectMemberUsage:()=>l,track:()=>d,trackAll:()=>f,traverseStoryboardExpressions:()=>u,traverseStoryboardFunction:()=>v,traverseStoryboardFunctions:()=>y,unwrapProvider:()=>c.unwrapProvider});var a=n("APP","getMenu"),i=n("INSTALLED_APPS","has"),s=r(7068),c=r(9387);function u(e,t,r){var o=new WeakSet,{matchExpressionString:n,visitNotMatchedExpressionString:a,visitNonExpressionString:i,visitObject:u}="string"==typeof r?{matchExpressionString:e=>e.includes(r)}:r;!function e(r){if("string"==typeof r)if((0,s.isEvaluable)(r))if(n(r))try{(0,s.preevaluate)(r,{withParent:!0,hooks:{beforeVisitGlobal(e,o){t(e,o,r)}}})}catch(e){console.error("Parse storyboard expression failed:",e)}else null==a||a(r);else null==i||i(r);else if((0,c.isObject)(r)){if(o.has(r))return;for(var l of(o.add(r),null==u||u(r),Array.isArray(r)?r:Object.values(r)))e(l)}}(e)}function l(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,{hasNonStaticUsage:o,nonStaticUsage:n,usedProperties:a}=p(e,t,r);if(o)throw new Error("Non-static usage of ".concat(t,' is prohibited, check your expression: "').concat(n,'"'));return a}function p(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n={usedProperties:new Set,hasNonStaticUsage:!1},a=o(n,t,r);return u(e,((e,t,r)=>{a(e,t),n.hasNonStaticUsage&&(n.nonStaticUsage=r)}),t),n}function d(e,t,r){if(e.includes(t)){var n,a={usedProperties:new Set,hasNonStaticUsage:!1},{expression:i}=(0,s.preevaluate)(e,{withParent:!0,hooks:{beforeVisitGlobal:o(a,r)}});if("SequenceExpression"===i.type&&(n=i.expressions[0])&&"Literal"===n.type&&n.value===t){if(a.usedProperties.size>0)return a.usedProperties;console.warn('You are using "'.concat(t,'" but no `').concat(r,"` usage found in your expression: ").concat(JSON.stringify(e)))}}return!1}function f(e){if(e){var t={usedProperties:new Set,hasNonStaticUsage:!1};if((0,s.preevaluate)(e,{withParent:!0,hooks:{beforeVisitGlobal:o(t,["CTX","STATE","FORM_STATE"],1,!0)}}),t.usedProperties.size>0){var r=[...t.usedProperties],n={context:!1,state:!1,formState:!1},a={CTX:"context",STATE:"state",FORM_STATE:"formState"};return r.forEach((e=>{var[t,r]=e.split(".");n[a[t]]||(n[a[t]]=[]),n[a[t]].push(r)})),n}console.warn('You are using track all but no "CTX" or "STATE" or "FORM_STATE" usage found in your expression: '.concat(JSON.stringify(e)))}return!1}function y(e,t){if(Array.isArray(e))for(var r of e)v(r,t)}function v(e,t,r){try{(0,s.precookFunction)(e.source,{typescript:e.typescript,withParent:!0,hooks:{beforeVisitGlobal:t}})}catch(t){r||console.error('Parse storyboard function "'.concat(e.name,'" failed:'),t)}}function g(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,a={usedProperties:new Set,hasNonStaticUsage:!1};if(v(e,o(a,t,n),r),a.hasNonStaticUsage&&!r)throw new Error("Non-static usage of ".concat(t,' is prohibited, check your function: "').concat(e.name,'"'));return a.usedProperties.delete(e.name),a.usedProperties}var h="PERMISSIONS",S="check";function b(e){var t,r=new Set,o=P(r),{customTemplates:n,functions:a}=null!==(t=e.meta)&&void 0!==t?t:{};return u([e.routes,n],o,h),y(a,o),Array.from(r)}function m(e){var t=new Set;return u(e,P(t),h),Array.from(t)}function P(e){return function(t,r){if(t.name===h){var o=r[r.length-1],n=r[r.length-2];if("CallExpression"===(null==n?void 0:n.node.type)&&"callee"===(null==n?void 0:n.key)&&"MemberExpression"===(null==o?void 0:o.node.type)&&"object"===o.key&&(o.node.computed?"Literal"===o.node.property.type&&o.node.property.value===S:"Identifier"===o.node.property.type&&o.node.property.name===S))for(var a of n.node.arguments)"Literal"===a.type&&"string"==typeof a.value&&e.add(a.value)}}}}}]);
2
+ //# sourceMappingURL=3933.e03c2b23.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"chunks/6314.b4d1e3d8.js","mappings":"+IAAO,SAASA,EAAwBC,EAAOC,GAC7C,IAAIC,EAAQC,UAAUC,OAAS,QAAsBC,IAAjBF,UAAU,GAAmBA,UAAU,GAAK,EAC5EG,EAAqBH,UAAUC,OAAS,QAAsBC,IAAjBF,UAAU,IAAmBA,UAAU,GACxF,OAAO,SAA2BI,EAAMC,GACtC,GAA0B,iBAAfP,EAA0BM,EAAKE,OAASR,EAAaA,EAAWS,SAASH,EAAKE,MAAO,CAE9F,IADA,IAAIE,EAAW,GACNC,EAAI,EAAGA,GAAKV,EAAOU,IAAK,CAC/B,IAAIC,EAAeL,EAAOA,EAAOJ,OAASQ,GAC1C,GAA6F,sBAAxFC,aAAmD,EAASA,EAAaN,KAAKO,OAAqD,WAArBD,EAAaE,IAAkB,CAChJ,IAAIC,EAAaH,EAAaN,KACzBS,EAAWC,UAAyC,eAA7BD,EAAWE,SAASJ,KAErCE,EAAWC,UAAyC,YAA7BD,EAAWE,SAASJ,MAA2D,iBAA9BE,EAAWE,SAASC,MACrGR,EAASS,KAAKd,EAAqB,GAAGe,OAAOd,EAAKE,KAAM,KAAKY,OAAOL,EAAWE,SAASC,OAASH,EAAWE,SAASC,OAErHnB,EAAMsB,mBAAoB,EAJ1BX,EAASS,KAAKd,EAAqB,GAAG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AAeL,EAAOA,EAAOJ,OAAS,GACtCwB,EAAapB,EAAOA,EAAOJ,OAAS,GACxC,GAAuF,oBAAlFwB,aAA+C,EAASA,EAAWrB,KAAKO,OAA2G,YAA5Ec,aAA+C,EAASA,EAAWb,MAA8G,sBAAxFF,aAAmD,EAASA,EAAaN,KAAKO,OAAqD,WAArBD,EAAaE,MAAqBF,EAAaN,KAAKU,SAA+C,YAApCJ,EAAaN,KAAKW,SAASJ,MAAsBD,EAAaN,KAAKW,SAASC,QAAUgF,EAA4C,eAApCtF,EAAaN,KAAKW,SAASJ,MAAyBD,EAAaN,KAAKW,SAAST,OAAS0F,GACtiB,IAAK,IAAIY,KAAOnF,EAAWrB,KAAKJ,UACb,YAAb4G,EAAIjG,MAA2C,iBAAdiG,EAAI5F,OACvCoF,EAAW/E,IAAIuF,EAAI5F,MAI3B,CACF,CACF,C","sources":["webpack:///../../node_modules/@next-core/utils/dist/esm/storyboard/expressions/beforeVisitGlobalMember.js","webpack:///../../node_modules/@next-core/utils/dist/esm/storyboard/expressions/collectMemberCallUsage.js","webpack:///../../node_modules/@next-core/utils/dist/esm/storyboard/expressions/traverse.js","webpack:///../../node_modules/@next-core/utils/dist/esm/storyboard/expressions/collectMemberUsage.js","webpack:///../../node_modules/@next-core/utils/dist/esm/storyboard/expressions/track.js","webpack:///../../node_modules/@next-core/utils/dist/esm/storyboard/functions/traverse.js","webpack:///../../node_modules/@next-core/utils/dist/esm/storyboard/functions/collectMemberUsageInFunction.js","webpack:///../../node_modules/@next-core/utils/dist/esm/storyboard/permissions.js"],"sourcesContent":["export function beforeVisitGlobalMember(usage, objectName) {\n var level = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n var rememberObjectName = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n return function beforeVisitGlobal(node, parent) {\n if (typeof objectName === \"string\" ? node.name === objectName : objectName.includes(node.name)) {\n var segments = [];\n for (var i = 1; i <= level; i++) {\n var memberParent = parent[parent.length - i];\n if ((memberParent === null || memberParent === void 0 ? void 0 : memberParent.node.type) === \"MemberExpression\" && memberParent.key === \"object\") {\n var memberNode = memberParent.node;\n if (!memberNode.computed && memberNode.property.type === \"Identifier\") {\n segments.push(rememberObjectName ? \"\".concat(node.name, \".\").concat(memberNode.property.name) : memberNode.property.name);\n } else if (memberNode.computed && memberNode.property.type === \"Literal\" && typeof memberNode.property.value === \"string\") {\n segments.push(rememberObjectName ? \"\".concat(node.name, \".\").concat(memberNode.property.value) : memberNode.property.value);\n } else {\n usage.hasNonStaticUsage = true;\n }\n } else {\n usage.hasNonStaticUsage = true;\n }\n }\n if (segments.length === level) {\n usage.usedProperties.add(segments.join(\".\"));\n }\n }\n };\n}\n//# sourceMappingURL=beforeVisitGlobalMember.js.map","function collectMemberCallUsageFactory(object, property) {\n return function collectMemberCallUsage(usage, node, parent) {\n if (node.name === object) {\n var memberParent = parent[parent.length - 1];\n var callParent = parent[parent.length - 2];\n if ((callParent === null || callParent === void 0 ? void 0 : callParent.node.type) === \"CallExpression\" && (callParent === null || callParent === void 0 ? void 0 : callParent.key) === \"callee\" && (memberParent === null || memberParent === void 0 ? void 0 : memberParent.node.type) === \"MemberExpression\" && memberParent.key === \"object\" && (memberParent.node.computed ? memberParent.node.property.type === \"Literal\" && memberParent.node.property.value === property : memberParent.node.property.type === \"Identifier\" && memberParent.node.property.name === property)) {\n var args = callParent.node.arguments;\n if (args.length > 0) {\n var firstArg = args[0];\n if (firstArg.type === \"Literal\" && typeof firstArg.value === \"string\") {\n usage.usedArgs.add(firstArg.value);\n } else {\n usage.hasNonStaticUsage = true;\n }\n }\n }\n }\n };\n}\nexport var collectAppGetMenuUsage = collectMemberCallUsageFactory(\"APP\", \"getMenu\");\nexport var collectInstalledAppsHasUsage = collectMemberCallUsageFactory(\"INSTALLED_APPS\", \"has\");\n//# sourceMappingURL=collectMemberCallUsage.js.map","import { isEvaluable, preevaluate } from \"@next-core/cook\";\nimport { isObject } from \"@next-core/utils/general\";\nexport function traverseStoryboardExpressions(data, beforeVisitGlobal,\n// If `options` is a string, it means the *keyword*.\noptions) {\n var memo = new WeakSet();\n var {\n matchExpressionString,\n visitNotMatchedExpressionString,\n visitNonExpressionString,\n visitObject\n } = typeof options === \"string\" ? {\n matchExpressionString: v => v.includes(options)\n } : options;\n function traverse(value) {\n if (typeof value === \"string\") {\n if (isEvaluable(value)) {\n if (matchExpressionString(value)) {\n try {\n preevaluate(value, {\n withParent: true,\n hooks: {\n beforeVisitGlobal(node, parent) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n beforeVisitGlobal(node, parent, value);\n }\n }\n });\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error(\"Parse storyboard expression failed:\", error);\n }\n } else {\n visitNotMatchedExpressionString === null || visitNotMatchedExpressionString === void 0 || visitNotMatchedExpressionString(value);\n }\n } else {\n visitNonExpressionString === null || visitNonExpressionString === void 0 || visitNonExpressionString(value);\n }\n } else if (isObject(value)) {\n // Avoid call stack overflow.\n if (memo.has(value)) {\n return;\n }\n memo.add(value);\n visitObject === null || visitObject === void 0 || visitObject(value);\n for (var item of Array.isArray(value) ? value : Object.values(value)) {\n traverse(item);\n }\n }\n }\n traverse(data);\n}\n//# sourceMappingURL=traverse.js.map","import { beforeVisitGlobalMember } from \"./beforeVisitGlobalMember.js\";\nimport { traverseStoryboardExpressions } from \"./traverse.js\";\nexport function strictCollectMemberUsage(data, objectName) {\n var level = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n var {\n hasNonStaticUsage,\n nonStaticUsage,\n usedProperties\n } = collectMemberUsage(data, objectName, level);\n if (hasNonStaticUsage) {\n throw new Error(\"Non-static usage of \".concat(objectName, \" is prohibited, check your expression: \\\"\").concat(nonStaticUsage, \"\\\"\"));\n }\n return usedProperties;\n}\nexport function collectMemberUsage(data, objectName) {\n var level = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n var usage = {\n usedProperties: new Set(),\n hasNonStaticUsage: false\n };\n var beforeVisitGlobal = beforeVisitGlobalMember(usage, objectName, level);\n traverseStoryboardExpressions(data, (node, parent, expr) => {\n beforeVisitGlobal(node, parent);\n if (usage.hasNonStaticUsage) {\n usage.nonStaticUsage = expr;\n }\n }, objectName);\n return usage;\n}\n//# sourceMappingURL=collectMemberUsage.js.map","import { preevaluate } from \"@next-core/cook\";\nimport { beforeVisitGlobalMember } from \"./beforeVisitGlobalMember.js\";\nexport function track(raw, trackText, variableName) {\n if (raw.includes(trackText)) {\n var usage = {\n usedProperties: new Set(),\n hasNonStaticUsage: false\n };\n var {\n expression\n } = preevaluate(raw, {\n withParent: true,\n hooks: {\n beforeVisitGlobal: beforeVisitGlobalMember(usage, variableName)\n }\n });\n var trackCtxExp;\n if (expression.type === \"SequenceExpression\" && (trackCtxExp = expression.expressions[0]) && trackCtxExp.type === \"Literal\" && trackCtxExp.value === trackText) {\n if (usage.usedProperties.size > 0) {\n return usage.usedProperties;\n } else {\n // eslint-disable-next-line no-console\n console.warn(\"You are using \\\"\".concat(trackText, \"\\\" but no `\").concat(variableName, \"` usage found in your expression: \").concat(JSON.stringify(raw)));\n }\n }\n }\n return false;\n}\nexport function trackAll(raw) {\n if (raw) {\n var usage = {\n usedProperties: new Set(),\n hasNonStaticUsage: false\n };\n preevaluate(raw, {\n withParent: true,\n hooks: {\n beforeVisitGlobal: beforeVisitGlobalMember(usage, [\"CTX\", \"STATE\", \"FORM_STATE\"], 1, true)\n }\n });\n if (usage.usedProperties.size > 0) {\n var usedProperites = [...usage.usedProperties];\n var result = {\n context: false,\n state: false,\n formState: false\n };\n var keyMap = {\n CTX: \"context\",\n STATE: \"state\",\n FORM_STATE: \"formState\"\n };\n usedProperites.forEach(item => {\n var [key, name] = item.split(\".\");\n if (!result[keyMap[key]]) {\n result[keyMap[key]] = [];\n }\n result[keyMap[key]].push(name);\n });\n return result;\n } else {\n // eslint-disable-next-line no-console\n console.warn(\"You are using track all but no \\\"CTX\\\" or \\\"STATE\\\" or \\\"FORM_STATE\\\" usage found in your expression: \".concat(JSON.stringify(raw)));\n }\n }\n return false;\n}\n//# sourceMappingURL=track.js.map","import { precookFunction } from \"@next-core/cook\";\nexport function traverseStoryboardFunctions(functions, beforeVisitGlobal) {\n if (Array.isArray(functions)) {\n for (var fn of functions) {\n traverseStoryboardFunction(fn, beforeVisitGlobal);\n }\n }\n}\nexport function traverseStoryboardFunction(fn, beforeVisitGlobal, silentErrors) {\n try {\n precookFunction(fn.source, {\n typescript: fn.typescript,\n withParent: true,\n hooks: {\n beforeVisitGlobal\n }\n });\n } catch (error) {\n if (!silentErrors) {\n // eslint-disable-next-line no-console\n console.error(\"Parse storyboard function \\\"\".concat(fn.name, \"\\\" failed:\"), error);\n }\n }\n}\n//# sourceMappingURL=traverse.js.map","import { beforeVisitGlobalMember } from \"../expressions/beforeVisitGlobalMember.js\";\nimport { traverseStoryboardFunction } from \"./traverse.js\";\nexport function collectMemberUsageInFunction(fn, objectName, silentErrors) {\n var level = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;\n var usage = {\n usedProperties: new Set(),\n hasNonStaticUsage: false\n };\n traverseStoryboardFunction(fn, beforeVisitGlobalMember(usage, objectName, level), silentErrors);\n if (usage.hasNonStaticUsage && !silentErrors) {\n throw new Error(\"Non-static usage of \".concat(objectName, \" is prohibited, check your function: \\\"\").concat(fn.name, \"\\\"\"));\n }\n usage.usedProperties.delete(fn.name);\n return usage.usedProperties;\n}\n//# sourceMappingURL=collectMemberUsageInFunction.js.map","import { traverseStoryboardExpressions } from \"./expressions/index.js\";\nimport { traverseStoryboardFunctions } from \"./functions/index.js\";\nvar PERMISSIONS = \"PERMISSIONS\";\nvar check = \"check\";\nexport function scanPermissionActionsInStoryboard(storyboard) {\n var _storyboard$meta;\n var collection = new Set();\n var beforeVisitPermissions = beforeVisitPermissionsFactory(collection);\n var {\n customTemplates,\n functions\n } = (_storyboard$meta = storyboard.meta) !== null && _storyboard$meta !== void 0 ? _storyboard$meta : {};\n traverseStoryboardExpressions([storyboard.routes, customTemplates], beforeVisitPermissions, PERMISSIONS);\n traverseStoryboardFunctions(functions, beforeVisitPermissions);\n return Array.from(collection);\n}\nexport function scanPermissionActionsInAny(data) {\n var collection = new Set();\n traverseStoryboardExpressions(data, beforeVisitPermissionsFactory(collection), PERMISSIONS);\n return Array.from(collection);\n}\nfunction beforeVisitPermissionsFactory(collection) {\n return function beforeVisitPermissions(node, parent) {\n if (node.name === PERMISSIONS) {\n var memberParent = parent[parent.length - 1];\n var callParent = parent[parent.length - 2];\n if ((callParent === null || callParent === void 0 ? void 0 : callParent.node.type) === \"CallExpression\" && (callParent === null || callParent === void 0 ? void 0 : callParent.key) === \"callee\" && (memberParent === null || memberParent === void 0 ? void 0 : memberParent.node.type) === \"MemberExpression\" && memberParent.key === \"object\" && (memberParent.node.computed ? memberParent.node.property.type === \"Literal\" && memberParent.node.property.value === check : memberParent.node.property.type === \"Identifier\" && memberParent.node.property.name === check)) {\n for (var arg of callParent.node.arguments) {\n if (arg.type === \"Literal\" && typeof arg.value === \"string\") {\n collection.add(arg.value);\n }\n }\n }\n }\n };\n}\n//# sourceMappingURL=permissions.js.map"],"names":["beforeVisitGlobalMember","usage","objectName","level","arguments","length","undefined","rememberObjectName","node","parent","name","includes","segments","i","memberParent","type","key","memberNode","computed","property","value","push","concat","hasNonStaticUsage","usedProperties","add","join","collectMemberCallUsageFactory","object","callParent","args","firstArg","usedArgs","collectAppGetMenuUsage","collectInstalledAppsHasUsage","traverseStoryboardExpressions","data","beforeVisitGlobal","options","memo","WeakSet","matchExpressionString","visitNotMatchedExpressionString","visitNonExpressionString","visitObject","v","traverse","isEvaluable","preevaluate","withParent","hooks","error","console","isObject","has","item","Array","isArray","Object","values","strictCollectMemberUsage","nonStaticUsage","collectMemberUsage","Error","Set","expr","track","raw","trackText","variableName","trackCtxExp","expression","expressions","size","warn","JSON","stringify","trackAll","usedProperites","result","context","state","formState","keyMap","CTX","STATE","FORM_STATE","forEach","split","traverseStoryboardFunctions","functions","fn","traverseStoryboardFunction","silentErrors","precookFunction","source","typescript","collectMemberUsageInFunction","delete","PERMISSIONS","check","scanPermissionActionsInStoryboard","storyboard","_storyboard$meta","collection","beforeVisitPermissions","beforeVisitPermissionsFactory","customTemplates","meta","routes","from","scanPermissionActionsInAny","arg"],"sourceRoot":""}
1
+ {"version":3,"file":"chunks/3933.e03c2b23.js","mappings":"+IAAO,SAASA,EAAwBC,EAAOC,GAC7C,IAAIC,EAAQC,UAAUC,OAAS,QAAsBC,IAAjBF,UAAU,GAAmBA,UAAU,GAAK,EAC5EG,EAAqBH,UAAUC,OAAS,QAAsBC,IAAjBF,UAAU,IAAmBA,UAAU,GACxF,OAAO,SAA2BI,EAAMC,GACtC,GAA0B,iBAAfP,EAA0BM,EAAKE,OAASR,EAAaA,EAAWS,SAASH,EAAKE,MAAO,CAE9F,IADA,IAAIE,EAAW,GACNC,EAAI,EAAGA,GAAKV,EAAOU,IAAK,CAC/B,IAAIC,EAAeL,EAAOA,EAAOJ,OAASQ,GAC1C,GAA6F,sBAAxFC,aAAmD,EAASA,EAAaN,KAAKO,OAAqD,WAArBD,EAAaE,IAAkB,CAChJ,IAAIC,EAAaH,EAAaN,KACzBS,EAAWC,UAAyC,eAA7BD,EAAWE,SAASJ,KAErCE,EAAWC,UAAyC,YAA7BD,EAAWE,SAASJ,MAA2D,iBAA9BE,EAAWE,SAASC,MACrGR,EAASS,KAAKd,EAAqB,GAAGe,OAAOd,EAAKE,KAAM,KAAKY,OAAOL,EAAWE,SAASC,OAASH,EAAWE,SAASC,OAErHnB,EAAMsB,mBAAoB,EAJ1BX,EAASS,KAAKd,EAAqB,GAAGe,OAAOd,EAAKE,KAAM,KAAKY,OAAOL,EAAWE,SAAST,MAAQO,EAAWE,SAAST,KAMxH,MACET,EAAMsB,mBAAoB,CAE9B,CACIX,EAASP,SAAWF,GACtBF,EAAMuB,eAAeC,IAAIb,EAASc,KAAK,KAE3C,CACF,CACF,CC1BA,SAASC,EAA8BC,EAAQT,GAC7C,OAAO,S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,EAAaN,KAAKU,SAA+C,YAApCJ,EAAaN,KAAKW,SAASJ,MAAsBD,EAAaN,KAAKW,SAASC,QAAUgF,EAA4C,eAApCtF,EAAaN,KAAKW,SAASJ,MAAyBD,EAAaN,KAAKW,SAAST,OAAS0F,GACtiB,IAAK,IAAIY,KAAOnF,EAAWrB,KAAKJ,UACb,YAAb4G,EAAIjG,MAA2C,iBAAdiG,EAAI5F,OACvCoF,EAAW/E,IAAIuF,EAAI5F,MAI3B,CACF,CACF,C","sources":["webpack:///../../node_modules/@next-core/utils/dist/esm/storyboard/expressions/beforeVisitGlobalMember.js","webpack:///../../node_modules/@next-core/utils/dist/esm/storyboard/expressions/collectMemberCallUsage.js","webpack:///../../node_modules/@next-core/utils/dist/esm/storyboard/expressions/traverse.js","webpack:///../../node_modules/@next-core/utils/dist/esm/storyboard/expressions/collectMemberUsage.js","webpack:///../../node_modules/@next-core/utils/dist/esm/storyboard/expressions/track.js","webpack:///../../node_modules/@next-core/utils/dist/esm/storyboard/functions/traverse.js","webpack:///../../node_modules/@next-core/utils/dist/esm/storyboard/functions/collectMemberUsageInFunction.js","webpack:///../../node_modules/@next-core/utils/dist/esm/storyboard/permissions.js"],"sourcesContent":["export function beforeVisitGlobalMember(usage, objectName) {\n var level = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n var rememberObjectName = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n return function beforeVisitGlobal(node, parent) {\n if (typeof objectName === \"string\" ? node.name === objectName : objectName.includes(node.name)) {\n var segments = [];\n for (var i = 1; i <= level; i++) {\n var memberParent = parent[parent.length - i];\n if ((memberParent === null || memberParent === void 0 ? void 0 : memberParent.node.type) === \"MemberExpression\" && memberParent.key === \"object\") {\n var memberNode = memberParent.node;\n if (!memberNode.computed && memberNode.property.type === \"Identifier\") {\n segments.push(rememberObjectName ? \"\".concat(node.name, \".\").concat(memberNode.property.name) : memberNode.property.name);\n } else if (memberNode.computed && memberNode.property.type === \"Literal\" && typeof memberNode.property.value === \"string\") {\n segments.push(rememberObjectName ? \"\".concat(node.name, \".\").concat(memberNode.property.value) : memberNode.property.value);\n } else {\n usage.hasNonStaticUsage = true;\n }\n } else {\n usage.hasNonStaticUsage = true;\n }\n }\n if (segments.length === level) {\n usage.usedProperties.add(segments.join(\".\"));\n }\n }\n };\n}\n//# sourceMappingURL=beforeVisitGlobalMember.js.map","function collectMemberCallUsageFactory(object, property) {\n return function collectMemberCallUsage(usage, node, parent) {\n if (node.name === object) {\n var memberParent = parent[parent.length - 1];\n var callParent = parent[parent.length - 2];\n if ((callParent === null || callParent === void 0 ? void 0 : callParent.node.type) === \"CallExpression\" && (callParent === null || callParent === void 0 ? void 0 : callParent.key) === \"callee\" && (memberParent === null || memberParent === void 0 ? void 0 : memberParent.node.type) === \"MemberExpression\" && memberParent.key === \"object\" && (memberParent.node.computed ? memberParent.node.property.type === \"Literal\" && memberParent.node.property.value === property : memberParent.node.property.type === \"Identifier\" && memberParent.node.property.name === property)) {\n var args = callParent.node.arguments;\n if (args.length > 0) {\n var firstArg = args[0];\n if (firstArg.type === \"Literal\" && typeof firstArg.value === \"string\") {\n usage.usedArgs.add(firstArg.value);\n } else {\n usage.hasNonStaticUsage = true;\n }\n }\n }\n }\n };\n}\nexport var collectAppGetMenuUsage = collectMemberCallUsageFactory(\"APP\", \"getMenu\");\nexport var collectInstalledAppsHasUsage = collectMemberCallUsageFactory(\"INSTALLED_APPS\", \"has\");\n//# sourceMappingURL=collectMemberCallUsage.js.map","import { isEvaluable, preevaluate } from \"@next-core/cook\";\nimport { isObject } from \"@next-core/utils/general\";\nexport function traverseStoryboardExpressions(data, beforeVisitGlobal,\n// If `options` is a string, it means the *keyword*.\noptions) {\n var memo = new WeakSet();\n var {\n matchExpressionString,\n visitNotMatchedExpressionString,\n visitNonExpressionString,\n visitObject\n } = typeof options === \"string\" ? {\n matchExpressionString: v => v.includes(options)\n } : options;\n function traverse(value) {\n if (typeof value === \"string\") {\n if (isEvaluable(value)) {\n if (matchExpressionString(value)) {\n try {\n preevaluate(value, {\n withParent: true,\n hooks: {\n beforeVisitGlobal(node, parent) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n beforeVisitGlobal(node, parent, value);\n }\n }\n });\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error(\"Parse storyboard expression failed:\", error);\n }\n } else {\n visitNotMatchedExpressionString === null || visitNotMatchedExpressionString === void 0 || visitNotMatchedExpressionString(value);\n }\n } else {\n visitNonExpressionString === null || visitNonExpressionString === void 0 || visitNonExpressionString(value);\n }\n } else if (isObject(value)) {\n // Avoid call stack overflow.\n if (memo.has(value)) {\n return;\n }\n memo.add(value);\n visitObject === null || visitObject === void 0 || visitObject(value);\n for (var item of Array.isArray(value) ? value : Object.values(value)) {\n traverse(item);\n }\n }\n }\n traverse(data);\n}\n//# sourceMappingURL=traverse.js.map","import { beforeVisitGlobalMember } from \"./beforeVisitGlobalMember.js\";\nimport { traverseStoryboardExpressions } from \"./traverse.js\";\nexport function strictCollectMemberUsage(data, objectName) {\n var level = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n var {\n hasNonStaticUsage,\n nonStaticUsage,\n usedProperties\n } = collectMemberUsage(data, objectName, level);\n if (hasNonStaticUsage) {\n throw new Error(\"Non-static usage of \".concat(objectName, \" is prohibited, check your expression: \\\"\").concat(nonStaticUsage, \"\\\"\"));\n }\n return usedProperties;\n}\nexport function collectMemberUsage(data, objectName) {\n var level = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n var usage = {\n usedProperties: new Set(),\n hasNonStaticUsage: false\n };\n var beforeVisitGlobal = beforeVisitGlobalMember(usage, objectName, level);\n traverseStoryboardExpressions(data, (node, parent, expr) => {\n beforeVisitGlobal(node, parent);\n if (usage.hasNonStaticUsage) {\n usage.nonStaticUsage = expr;\n }\n }, objectName);\n return usage;\n}\n//# sourceMappingURL=collectMemberUsage.js.map","import { preevaluate } from \"@next-core/cook\";\nimport { beforeVisitGlobalMember } from \"./beforeVisitGlobalMember.js\";\nexport function track(raw, trackText, variableName) {\n if (raw.includes(trackText)) {\n var usage = {\n usedProperties: new Set(),\n hasNonStaticUsage: false\n };\n var {\n expression\n } = preevaluate(raw, {\n withParent: true,\n hooks: {\n beforeVisitGlobal: beforeVisitGlobalMember(usage, variableName)\n }\n });\n var trackCtxExp;\n if (expression.type === \"SequenceExpression\" && (trackCtxExp = expression.expressions[0]) && trackCtxExp.type === \"Literal\" && trackCtxExp.value === trackText) {\n if (usage.usedProperties.size > 0) {\n return usage.usedProperties;\n } else {\n // eslint-disable-next-line no-console\n console.warn(\"You are using \\\"\".concat(trackText, \"\\\" but no `\").concat(variableName, \"` usage found in your expression: \").concat(JSON.stringify(raw)));\n }\n }\n }\n return false;\n}\nexport function trackAll(raw) {\n if (raw) {\n var usage = {\n usedProperties: new Set(),\n hasNonStaticUsage: false\n };\n preevaluate(raw, {\n withParent: true,\n hooks: {\n beforeVisitGlobal: beforeVisitGlobalMember(usage, [\"CTX\", \"STATE\", \"FORM_STATE\"], 1, true)\n }\n });\n if (usage.usedProperties.size > 0) {\n var usedProperites = [...usage.usedProperties];\n var result = {\n context: false,\n state: false,\n formState: false\n };\n var keyMap = {\n CTX: \"context\",\n STATE: \"state\",\n FORM_STATE: \"formState\"\n };\n usedProperites.forEach(item => {\n var [key, name] = item.split(\".\");\n if (!result[keyMap[key]]) {\n result[keyMap[key]] = [];\n }\n result[keyMap[key]].push(name);\n });\n return result;\n } else {\n // eslint-disable-next-line no-console\n console.warn(\"You are using track all but no \\\"CTX\\\" or \\\"STATE\\\" or \\\"FORM_STATE\\\" usage found in your expression: \".concat(JSON.stringify(raw)));\n }\n }\n return false;\n}\n//# sourceMappingURL=track.js.map","import { precookFunction } from \"@next-core/cook\";\nexport function traverseStoryboardFunctions(functions, beforeVisitGlobal) {\n if (Array.isArray(functions)) {\n for (var fn of functions) {\n traverseStoryboardFunction(fn, beforeVisitGlobal);\n }\n }\n}\nexport function traverseStoryboardFunction(fn, beforeVisitGlobal, silentErrors) {\n try {\n precookFunction(fn.source, {\n typescript: fn.typescript,\n withParent: true,\n hooks: {\n beforeVisitGlobal\n }\n });\n } catch (error) {\n if (!silentErrors) {\n // eslint-disable-next-line no-console\n console.error(\"Parse storyboard function \\\"\".concat(fn.name, \"\\\" failed:\"), error);\n }\n }\n}\n//# sourceMappingURL=traverse.js.map","import { beforeVisitGlobalMember } from \"../expressions/beforeVisitGlobalMember.js\";\nimport { traverseStoryboardFunction } from \"./traverse.js\";\nexport function collectMemberUsageInFunction(fn, objectName, silentErrors) {\n var level = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;\n var usage = {\n usedProperties: new Set(),\n hasNonStaticUsage: false\n };\n traverseStoryboardFunction(fn, beforeVisitGlobalMember(usage, objectName, level), silentErrors);\n if (usage.hasNonStaticUsage && !silentErrors) {\n throw new Error(\"Non-static usage of \".concat(objectName, \" is prohibited, check your function: \\\"\").concat(fn.name, \"\\\"\"));\n }\n usage.usedProperties.delete(fn.name);\n return usage.usedProperties;\n}\n//# sourceMappingURL=collectMemberUsageInFunction.js.map","import { traverseStoryboardExpressions } from \"./expressions/index.js\";\nimport { traverseStoryboardFunctions } from \"./functions/index.js\";\nvar PERMISSIONS = \"PERMISSIONS\";\nvar check = \"check\";\nexport function scanPermissionActionsInStoryboard(storyboard) {\n var _storyboard$meta;\n var collection = new Set();\n var beforeVisitPermissions = beforeVisitPermissionsFactory(collection);\n var {\n customTemplates,\n functions\n } = (_storyboard$meta = storyboard.meta) !== null && _storyboard$meta !== void 0 ? _storyboard$meta : {};\n traverseStoryboardExpressions([storyboard.routes, customTemplates], beforeVisitPermissions, PERMISSIONS);\n traverseStoryboardFunctions(functions, beforeVisitPermissions);\n return Array.from(collection);\n}\nexport function scanPermissionActionsInAny(data) {\n var collection = new Set();\n traverseStoryboardExpressions(data, beforeVisitPermissionsFactory(collection), PERMISSIONS);\n return Array.from(collection);\n}\nfunction beforeVisitPermissionsFactory(collection) {\n return function beforeVisitPermissions(node, parent) {\n if (node.name === PERMISSIONS) {\n var memberParent = parent[parent.length - 1];\n var callParent = parent[parent.length - 2];\n if ((callParent === null || callParent === void 0 ? void 0 : callParent.node.type) === \"CallExpression\" && (callParent === null || callParent === void 0 ? void 0 : callParent.key) === \"callee\" && (memberParent === null || memberParent === void 0 ? void 0 : memberParent.node.type) === \"MemberExpression\" && memberParent.key === \"object\" && (memberParent.node.computed ? memberParent.node.property.type === \"Literal\" && memberParent.node.property.value === check : memberParent.node.property.type === \"Identifier\" && memberParent.node.property.name === check)) {\n for (var arg of callParent.node.arguments) {\n if (arg.type === \"Literal\" && typeof arg.value === \"string\") {\n collection.add(arg.value);\n }\n }\n }\n }\n };\n}\n//# sourceMappingURL=permissions.js.map"],"names":["beforeVisitGlobalMember","usage","objectName","level","arguments","length","undefined","rememberObjectName","node","parent","name","includes","segments","i","memberParent","type","key","memberNode","computed","property","value","push","concat","hasNonStaticUsage","usedProperties","add","join","collectMemberCallUsageFactory","object","callParent","args","firstArg","usedArgs","collectAppGetMenuUsage","collectInstalledAppsHasUsage","traverseStoryboardExpressions","data","beforeVisitGlobal","options","memo","WeakSet","matchExpressionString","visitNotMatchedExpressionString","visitNonExpressionString","visitObject","v","traverse","isEvaluable","preevaluate","withParent","hooks","error","console","isObject","has","item","Array","isArray","Object","values","strictCollectMemberUsage","nonStaticUsage","collectMemberUsage","Error","Set","expr","track","raw","trackText","variableName","trackCtxExp","expression","expressions","size","warn","JSON","stringify","trackAll","usedProperites","result","context","state","formState","keyMap","CTX","STATE","FORM_STATE","forEach","split","traverseStoryboardFunctions","functions","fn","traverseStoryboardFunction","silentErrors","precookFunction","source","typescript","collectMemberUsageInFunction","delete","PERMISSIONS","check","scanPermissionActionsInStoryboard","storyboard","_storyboard$meta","collection","beforeVisitPermissions","beforeVisitPermissionsFactory","customTemplates","meta","routes","from","scanPermissionActionsInAny","arg"],"sourceRoot":""}
@@ -1,2 +1,2 @@
1
- "use strict";(self.webpackChunk_next_bricks_visual_builder=self.webpackChunk_next_bricks_visual_builder||[]).push([[5552,3171,790],{5552:(e,i,n)=>{n.r(i),n.d(i,{i18n:()=>f,i18nText:()=>c,initializeI18n:()=>l});var r=n(2350),t=n(8799),a=n(7072),s=!1,u=new Set;function l(e,i){if(s||(s=!0,t.i18n.use(a.default).init({fallbackLng:"zh",debug:!1,supportedLngs:["zh","en"],nonExplicitSupportedLngs:!0,interpolation:{escapeValue:!1},react:{useSuspense:!1},compatibilityJSON:"v3",resources:{}})),e&&i&&!u.has(e))for(var[n,r]of(u.add(e),Object.entries(i)))t.i18n.addResourceBundle(n,e,r)}var o=n(8594);function c(e){var i;if(e){var n=null!==(i=t.i18n.language)&&void 0!==i?i:"zh-CN";if((0,o.hasOwnProperty)(e,n))return e[n];var r=n.split("-")[0];if(r!==n)return(0,o.hasOwnProperty)(e,r)?e[r]:void 0;var a="".concat(r,"-");for(var s of Object.keys(e))if(s.startsWith(a))return e[s]}}var f=r.default}}]);
2
- //# sourceMappingURL=5552.a2515c4d.js.map
1
+ "use strict";(self.webpackChunk_next_bricks_visual_builder=self.webpackChunk_next_bricks_visual_builder||[]).push([[5552,3171,790],{5552:(e,i,n)=>{n.r(i),n.d(i,{i18n:()=>f,i18nText:()=>c,initializeI18n:()=>l});var r=n(2350),t=n(8799),a=n(7072),s=!1,u=new Set;function l(e,i){if(s||(s=!0,t.i18n.use(a.default).init({fallbackLng:"zh",debug:!1,supportedLngs:["zh","en"],nonExplicitSupportedLngs:!0,interpolation:{escapeValue:!1},react:{useSuspense:!1},compatibilityJSON:"v3",resources:{}})),e&&i&&!u.has(e))for(var[n,r]of(u.add(e),Object.entries(i)))t.i18n.addResourceBundle(n,e,r)}var o=n(9387);function c(e){var i;if(e){var n=null!==(i=t.i18n.language)&&void 0!==i?i:"zh-CN";if((0,o.hasOwnProperty)(e,n))return e[n];var r=n.split("-")[0];if(r!==n)return(0,o.hasOwnProperty)(e,r)?e[r]:void 0;var a="".concat(r,"-");for(var s of Object.keys(e))if(s.startsWith(a))return e[s]}}var f=r.default}}]);
2
+ //# sourceMappingURL=5552.c7215ea8.js.map