@next-bricks/visual-builder 1.32.2 → 1.32.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bricks.json +8 -8
- package/dist/chunks/2252.e622a0bf.js +3 -0
- package/dist/chunks/2252.e622a0bf.js.map +1 -0
- package/dist/chunks/{2980.51717b3f.js → 2980.292113dc.js} +2 -2
- package/dist/chunks/{2980.51717b3f.js.map → 2980.292113dc.js.map} +1 -1
- package/dist/chunks/{4837.58fb5576.js → 4837.bbfcab3d.js} +2 -2
- package/dist/chunks/{4837.58fb5576.js.map → 4837.bbfcab3d.js.map} +1 -1
- package/dist/chunks/{7150.62236b96.js → 7150.7f545689.js} +3 -3
- package/dist/chunks/7150.7f545689.js.map +1 -0
- package/dist/chunks/{7218.417c6054.js → 7218.30573c75.js} +2 -2
- package/dist/chunks/{7218.417c6054.js.map → 7218.30573c75.js.map} +1 -1
- package/dist/chunks/{9027.e3490283.js → 9027.5ba5abc4.js} +2 -2
- package/dist/chunks/{9027.e3490283.js.map → 9027.5ba5abc4.js.map} +1 -1
- package/dist/chunks/9080.8ae16d3a.js +2 -0
- package/dist/chunks/9080.8ae16d3a.js.map +1 -0
- package/dist/chunks/{chat-preview.f7014cdb.js → chat-preview.9da15245.js} +3 -3
- package/dist/chunks/{chat-preview.f7014cdb.js.map → chat-preview.9da15245.js.map} +1 -1
- package/dist/chunks/{check-editor-by-name.7e2f27ec.js → check-editor-by-name.ac2dd0e0.js} +2 -2
- package/dist/chunks/{check-editor-by-name.7e2f27ec.js.map → check-editor-by-name.ac2dd0e0.js.map} +1 -1
- package/dist/chunks/{contract-select.858bf125.js → contract-select.b2bbe319.js} +3 -3
- package/dist/chunks/{contract-select.858bf125.js.map → contract-select.b2bbe319.js.map} +1 -1
- package/dist/chunks/{main.c7fa0277.js → main.a1ceb1c1.js} +2 -2
- package/dist/chunks/{main.c7fa0277.js.map → main.a1ceb1c1.js.map} +1 -1
- package/dist/chunks/{pre-generated-container.d2f83710.js → pre-generated-container.1f208112.js} +2 -2
- package/dist/chunks/{pre-generated-container.d2f83710.js.map → pre-generated-container.1f208112.js.map} +1 -1
- package/dist/chunks/{pre-generated-preview.03d5b930.js → pre-generated-preview.eca3bbb1.js} +3 -3
- package/dist/chunks/{pre-generated-preview.03d5b930.js.map → pre-generated-preview.eca3bbb1.js.map} +1 -1
- package/dist/chunks/property-editor.17a7f5aa.js +2 -0
- package/dist/chunks/property-editor.17a7f5aa.js.map +1 -0
- package/dist/chunks/{workbench-action-list.dbcbbdac.js → workbench-action-list.a187250b.js} +2 -2
- package/dist/chunks/{workbench-action-list.dbcbbdac.js.map → workbench-action-list.a187250b.js.map} +1 -1
- package/dist/chunks/{workbench-history-action.a713bacf.js → workbench-history-action.fc8db5e1.js} +3 -3
- package/dist/chunks/{workbench-history-action.a713bacf.js.map → workbench-history-action.fc8db5e1.js.map} +1 -1
- package/dist/{index.39c1b24a.js → index.cc7a543d.js} +2 -2
- package/dist/{index.39c1b24a.js.map → index.cc7a543d.js.map} +1 -1
- package/dist/manifest.json +9 -9
- package/dist/types.json +404 -404
- package/package.json +2 -2
- package/dist/chunks/2252.8c147e6c.js +0 -3
- package/dist/chunks/2252.8c147e6c.js.map +0 -1
- package/dist/chunks/7150.62236b96.js.map +0 -1
- package/dist/chunks/9080.c73b20aa.js +0 -2
- package/dist/chunks/9080.c73b20aa.js.map +0 -1
- package/dist/chunks/property-editor.a3793d5c.js +0 -2
- package/dist/chunks/property-editor.a3793d5c.js.map +0 -1
- /package/dist/chunks/{2252.8c147e6c.js.LICENSE.txt → 2252.e622a0bf.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{7150.62236b96.js.LICENSE.txt → 7150.7f545689.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{chat-preview.f7014cdb.js.LICENSE.txt → chat-preview.9da15245.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{contract-select.858bf125.js.LICENSE.txt → contract-select.b2bbe319.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{pre-generated-preview.03d5b930.js.LICENSE.txt → pre-generated-preview.eca3bbb1.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{workbench-history-action.a713bacf.js.LICENSE.txt → workbench-history-action.fc8db5e1.js.LICENSE.txt} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";(globalThis.webpackChunk_next_bricks_visual_builder=globalThis.webpackChunk_next_bricks_visual_builder||[]).push([[7218,4837],{4837:(e,r,t)=>{t.r(r),t.d(r,{ReactUseBrick:()=>c,ReactUseMultipleBricks:()=>u,asyncWrapBrick:()=>k,useCurrentApp:()=>l,useCurrentTheme:()=>i,useLazyWrapBrick:()=>h,useNavConfig:()=>_,useProvider:()=>v,useRecentApps:()=>o,useRouteRender:()=>d});var n=t(8769),s=t(
|
|
2
|
-
//# sourceMappingURL=7218.
|
|
1
|
+
"use strict";(globalThis.webpackChunk_next_bricks_visual_builder=globalThis.webpackChunk_next_bricks_visual_builder||[]).push([[7218,4837],{4837:(e,r,t)=>{t.r(r),t.d(r,{ReactUseBrick:()=>c,ReactUseMultipleBricks:()=>u,asyncWrapBrick:()=>k,useCurrentApp:()=>l,useCurrentTheme:()=>i,useLazyWrapBrick:()=>h,useNavConfig:()=>_,useProvider:()=>v,useRecentApps:()=>o,useRouteRender:()=>d});var n=t(8769),s=t(1094);let c=function(e){let{useBrick:r,data:t,errorBoundary:c,refCallback:u,ignoredCallback:a}=e;const[i,o]=(0,n.useState)(null),l=(0,n.useRef)(),[d,f]=(0,n.useState)(),p=(0,n.useRef)(0),g=(0,n.useMemo)((()=>{var e;return null===(e=s.__secret_internals.getRenderId)||void 0===e?void 0:e.call(s.__secret_internals)}),[]);(0,n.useEffect)((()=>{let e=!1;return async function(){try{const n=await s.__secret_internals.renderUseBrick(r,t,c);if(e)return;o(n),f(++p.current)}catch(n){!e&&function(e){var r;const t=null===(r=s.__secret_internals.getRenderId)||void 0===r?void 0:r.call(s.__secret_internals);return!e||!t||e===t}(g)&&(console.error("Render useBrick failed:",r,"with data:",t),(0,s.handleHttpError)(n))}}(),()=>{e=!0}}),[t,r,g,c]);const y=(0,n.useCallback)((e=>{e?l.current=s.__secret_internals.mountUseBrick(i,e):(s.__secret_internals.unmountUseBrick(i,l.current),l.current=void 0),null==u||u(e)}),[u,i]);if(!i)return null;const{tagName:v}=i;if(null===v)return null==a||a(),null;const m=v;return n.createElement(m,{key:d,ref:y})},u=function(e){let{useBrick:r,data:t,errorBoundary:s}=e;return Array.isArray(r)?n.createElement(n.Fragment,null,r.map(((e,r)=>n.createElement(c,{key:r,useBrick:e,data:t,errorBoundary:s})))):n.createElement(c,{useBrick:r,data:t,errorBoundary:s})};const a=(0,s.getV2RuntimeFromDll)();if(a){const{SingleBrickAsComponentFactory:e,BrickAsComponentFactory:r}=a;e&&r&&(c=e(n),u=r(n))}function i(){const[e,r]=(0,n.useState)(s.getCurrentTheme);return(0,n.useEffect)((()=>{const e=e=>{r(e.detail)};return window.addEventListener("theme.change",e),()=>{window.removeEventListener("theme.change",e)}}),[]),e}function o(){const[e,r]=n.useState((()=>(0,s.getRuntime)().getRecentApps()));return n.useEffect((()=>{const e=e=>{r(e.detail)};return window.addEventListener("app.change",e),()=>window.removeEventListener("app.change",e)}),[]),e}function l(){return o().currentApp}function d(){const[e,r]=n.useState(null);return n.useEffect((()=>{const e=e=>{r(e.detail)};return window.addEventListener("route.render",e),()=>window.removeEventListener("route.render",e)}),[]),e}const f={provider:"",customOptions:{onError:()=>{},transform:(e,r)=>r,data:void 0,loading:!1,suspense:!1,cache:!0},dependencies:void 0},p=Object.entries(f).reduce(((e,r)=>{let[t,n]=r;return"[object Object]"===Object.prototype.toString.call(n)?{...e,...n}:{...e,[t]:n}}),{});var g=t(1030);const y=new Map;function v(){const{provider:e,customOptions:r,dependencies:t,requestInit:c}=function(e,r,t){const s=(0,n.useMemo)((()=>"string"==typeof e?e:f.provider),[e,r]),c=(0,n.useMemo)((()=>{let t={};return(0,g.isObject)(e)?t=e:(0,g.isObject)(r)&&(t=r),{...p,...t}}),[e,r]),u=(0,n.useMemo)((()=>{const e=[...Object.keys(f),...Object.keys(f.customOptions)],{args:r=null,...t}=Object.keys(c).reduce(((r,t)=>(e.includes(t)||(r[t]=c[t]),r)),{});return{options:{...t},args:r}}),[c]),a=(0,n.useMemo)((()=>Array.isArray(r)?r:Array.isArray(t)?t:p.dependencies),[r,t]),i=c.loading||Array.isArray(a);return{provider:s,customOptions:(0,n.useMemo)((()=>({...Object.keys(f.customOptions).reduce(((e,r)=>(e[r]=c[r],e)),{}),loading:i})),[c]),requestInit:u,dependencies:a}}(...arguments),{onError:u,transform:a,suspense:i,cache:o,...l}=r,[d,v]=(0,n.useState)(l.loading),m=(0,n.useRef)("pending"),k=(0,n.useRef)(),_=(0,n.useRef)(!1),h=(0,n.useRef)(),w=(0,n.useRef)(),b=(0,n.useRef)(l.data),B=(0,n.useReducer)((()=>({})),[])[1],E=(0,n.useCallback)((async(e,r)=>{try{h.current=void 0,i||v(!0);const t=await async function(e,r,t){let n;const c=function(e){const r=e=>Object.keys(e).sort().map((r=>({[r]:e[r]})));for(var t=arguments.length,n=new Array(t>1?t-1:0),s=1;s<t;s++)n[s-1]=arguments[s];try{const t="object"!=typeof(c=n)||null===c||Array.isArray(c)?n.map((e=>function(e){return"string"==typeof e}(e)?e:r(e))):r(n);return JSON.stringify({provider:e,args:t})}catch(r){return JSON.stringify({provider:e,args:n})}var c}(e,...t);return!r&&y.has(c)&&y.delete(c),y.has(c)?n=y.get(c):(n=(0,s.fetchByProvider)(e,t),r&&y.set(c,n)),n}(e,o,r);w.current=t,b.current=a(b.current,t)}catch(e){h.current=e,b.current=void 0}return i||v(!1),h.current&&u(h.current),b.current}),[e,r,t,c,i,a,l.data,u,o]),O=(0,n.useCallback)((async(r,t)=>{let n=e,s=[];return(0,g.isString)(r)&&(n=r),(0,g.isObject)(r)?s=r:(0,g.isObject)(t)&&(s=t),i?(async()=>(k.current=E(n,s).then((e=>(m.current="success",e)),(e=>(m.current="error",e.current=e,e))),B(),await k.current))():E(n,s)}),[E]),R=(0,n.useMemo)((()=>Object.defineProperties({query:O},{loading:{get:()=>d},data:{get:()=>b.current},error:{get:()=>h.current}})),[O]);if((0,n.useEffect)((()=>(_.current=!0,Array.isArray(t)&&e&&R.query(e,c.args),()=>_.current=!1)),t),i&&k.current)switch(m.current){case"pending":throw k.current;case"error":throw h.current}return Object.assign([R,w.current,d,h.current],{request:R,...R,response:w.current,data:b.current,loading:d,error:h.current})}var m=t(1389);async function k(e,r){return await s.__secret_internals.loadBricks([e]),(0,m.wrapBrick)(e,r)}function _(){const[e,r]=(0,n.useState)((()=>(0,s.getRuntime)().getNavConfig()));return(0,n.useEffect)((()=>{const e=e=>{r(e.detail)};return window.addEventListener("navConfig.change",e),()=>window.removeEventListener("navConfig.change",e)}),[]),e}function h(e,r){return(0,n.useMemo)((()=>null!=e?(0,n.lazy)((async()=>({default:await k(e,r)}))):null),[e,r])}}}]);
|
|
2
|
+
//# sourceMappingURL=7218.30573c75.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunks/7218.417c6054.js","mappings":"wZAIA,IAAIA,EAAgB,SAAuBC,GACzC,IAAI,SACFC,EAAQ,KACRC,EAAI,cACJC,EAAa,YACbC,EAAW,gBACXC,GACEL,EACJ,MAAOM,EAAcC,IAAmB,IAAAC,UAAS,MAC3CC,GAAc,IAAAC,WACbC,EAAWC,IAAgB,IAAAJ,YAC5BK,GAAe,IAAAH,QAAO,GACtBI,GAAkB,IAAAC,UAAQ,KAC9B,IAAIC,EACJ,OAAmE,QAA3DA,EAAuB,EAAAC,mBAAmBC,mBAAkD,IAAzBF,OAAkC,EAASA,EAAqBG,KAAK,EAAAF,mBAAmB,GAClK,KACH,IAAAG,YAAU,KACR,IAAIC,GAAS,EAkBb,OAjBAC,iBACE,IACE,MAAMC,QAAkB,EAAAN,mBAAmBO,eAAevB,EAAUC,EAAMC,GAC1E,GAAIkB,EACF,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OAAO6D,OAAOkE,OAAO,CAACH,EAASjC,EAAS3F,QAASyD,EAASxD,EAAMD,SAAU,CACxE4H,aACGA,EACHjC,SAAUA,EAAS3F,QACnBvB,KAAMA,EAAKuB,QACXyD,UACAxD,MAAOA,EAAMD,SAEjB,C,cEjGOH,eAAemI,EAAeC,EAAWC,GAE9C,aADM,EAAA1I,mBAAmB2I,WAAW,CAACF,KAC9B,IAAAG,WAAUH,EAAWC,EAC9B,CClBO,SAASG,IACd,MAAOC,EAAWC,IAAgB,IAAAxJ,WAAS,KAAM,IAAA2D,cAAa8F,iBAQ9D,OAPA,IAAA7I,YAAU,KACR,MAAMiD,EAAWV,IACfqG,EAAarG,EAAMC,OAAO,EAG5B,OADAC,OAAOC,iBAAiB,mBAAoBO,GACrC,IAAMR,OAAOE,oBAAoB,mBAAoBM,EAAS,GACpE,IACI0F,CACT,CC2CO,SAASG,EAAiBR,EAAWC,GAC1C,OAAO,IAAA5I,UAAQ,IACI,MAAb2I,GACkB,IAAAS,OAAK7I,UAAY,CACnC8I,cAAeX,EAAeC,EAAWC,OAGtC,MACN,CAACD,EAAWC,GACjB,C","sources":["webpack:///../../node_modules/@next-core/react-runtime/dist/esm/ReactUseBrick.js","webpack:///../../node_modules/@next-core/react-runtime/dist/esm/useCurrentTheme.js","webpack:///../../node_modules/@next-core/react-runtime/dist/esm/useRecentApps.js","webpack:///../../node_modules/@next-core/react-runtime/dist/esm/useCurrentApp.js","webpack:///../../node_modules/@next-core/react-runtime/dist/esm/useRouteRender.js","webpack:///../../node_modules/@next-core/react-runtime/dist/esm/useProvider/useProviderArgsDefaults.js","webpack:///../../node_modules/@next-core/react-runtime/dist/esm/useProvider/fetch.js","webpack:///../../node_modules/@next-core/react-runtime/dist/esm/useProvider/useProvider.js","webpack:///../../node_modules/@next-core/react-runtime/dist/esm/useProvider/useProviderArgs.js","webpack:///../../node_modules/@next-core/react-runtime/dist/esm/asyncWrapBrick.js","webpack:///../../node_modules/@next-core/react-runtime/dist/esm/useNavConfig.js","webpack:///../../node_modules/@next-core/react-runtime/dist/esm/useLazyWrapBrick.js"],"sourcesContent":["import React, { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport { __secret_internals, handleHttpError, getV2RuntimeFromDll } from \"@next-core/runtime\";\n// Note: always synchronize code in LegacyUseBrick:\n// `bricks/v2-adapter/src/data-providers/legacy-brick-kit/getLegacyUseBrick.ts`\nlet ReactUseBrick = function ReactUseBrick(_ref) {\n let {\n useBrick,\n data,\n errorBoundary,\n refCallback,\n ignoredCallback\n } = _ref;\n const [renderResult, setRenderResult] = useState(null);\n const mountResult = useRef();\n const [renderKey, setRenderKey] = useState();\n const IdCounterRef = useRef(0);\n const initialRenderId = useMemo(() => {\n var _secret_internals$ge;\n return (_secret_internals$ge = __secret_internals.getRenderId) === null || _secret_internals$ge === void 0 ? void 0 : _secret_internals$ge.call(__secret_internals);\n }, []);\n useEffect(() => {\n let ignore = false;\n async function init() {\n try {\n const newRender = await __secret_internals.renderUseBrick(useBrick, data, errorBoundary);\n if (ignore) {\n return;\n }\n setRenderResult(newRender);\n setRenderKey(getUniqueId(IdCounterRef));\n } catch (error) {\n if (!ignore && isTheSameRender(initialRenderId)) {\n // eslint-disable-next-line no-console\n console.error(\"Render useBrick failed:\", useBrick, \"with data:\", data);\n handleHttpError(error);\n }\n }\n }\n init();\n return () => {\n ignore = true;\n };\n }, [data, useBrick, initialRenderId, errorBoundary]);\n const _refCallback = useCallback(element => {\n if (element) {\n mountResult.current = __secret_internals.mountUseBrick(\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n renderResult, element);\n } else {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n __secret_internals.unmountUseBrick(renderResult, mountResult.current);\n mountResult.current = undefined;\n }\n refCallback === null || refCallback === void 0 || refCallback(element);\n }, [refCallback, renderResult]);\n if (!renderResult) {\n // Fallback when loading/\n return null;\n // return <span>🌀 Loading...</span>;\n }\n const {\n tagName\n } = renderResult;\n if (tagName === null) {\n ignoredCallback === null || ignoredCallback === void 0 || ignoredCallback();\n return null;\n }\n const WebComponent = tagName;\n return /*#__PURE__*/React.createElement(WebComponent, {\n key: renderKey,\n ref: _refCallback\n });\n};\nfunction getUniqueId(ref) {\n return ++ref.current;\n}\nfunction isTheSameRender(initialRenderId) {\n var _secret_internals$ge2;\n const newRenderId = (_secret_internals$ge2 = __secret_internals.getRenderId) === null || _secret_internals$ge2 === void 0 ? void 0 : _secret_internals$ge2.call(__secret_internals);\n return !initialRenderId || !newRenderId || initialRenderId === newRenderId;\n}\nlet ReactUseMultipleBricks = function ReactUseMultipleBricks(_ref2) {\n let {\n useBrick,\n data,\n errorBoundary\n } = _ref2;\n if (Array.isArray(useBrick)) {\n return /*#__PURE__*/React.createElement(React.Fragment, null, useBrick.map((item, index) => /*#__PURE__*/React.createElement(ReactUseBrick, {\n key: index,\n useBrick: item,\n data: data,\n errorBoundary: errorBoundary\n })));\n }\n return /*#__PURE__*/React.createElement(ReactUseBrick, {\n useBrick: useBrick,\n data: data,\n errorBoundary: errorBoundary\n });\n};\n\n// Make v3 bricks compatible with Brick Next v2.\n// istanbul ignore next\nconst v2Kit = getV2RuntimeFromDll();\n// istanbul ignore next\nif (v2Kit) {\n const {\n SingleBrickAsComponentFactory,\n BrickAsComponentFactory\n } = v2Kit;\n if (SingleBrickAsComponentFactory && BrickAsComponentFactory) {\n ReactUseBrick = SingleBrickAsComponentFactory(React);\n ReactUseMultipleBricks = BrickAsComponentFactory(React);\n }\n}\nexport { ReactUseBrick, ReactUseMultipleBricks };\n//# sourceMappingURL=ReactUseBrick.js.map","import { useEffect, useState } from \"react\";\nimport { getCurrentTheme } from \"@next-core/runtime\";\nexport function useCurrentTheme() {\n const [currentTheme, setCurrentTheme] = useState(getCurrentTheme);\n useEffect(() => {\n const listenToThemeChange = event => {\n setCurrentTheme(event.detail);\n };\n window.addEventListener(\"theme.change\", listenToThemeChange);\n return () => {\n window.removeEventListener(\"theme.change\", listenToThemeChange);\n };\n }, []);\n return currentTheme;\n}\n//# sourceMappingURL=useCurrentTheme.js.map","import React from \"react\";\nimport { getRuntime } from \"@next-core/runtime\";\nexport function useRecentApps() {\n const [recentApps, setRecentApps] = React.useState(() => getRuntime().getRecentApps());\n React.useEffect(() => {\n const listener = event => {\n setRecentApps(event.detail);\n };\n window.addEventListener(\"app.change\", listener);\n return () => window.removeEventListener(\"app.change\", listener);\n }, []);\n return recentApps;\n}\n//# sourceMappingURL=useRecentApps.js.map","import { useRecentApps } from \"./useRecentApps.js\";\n\n/**\n * 获取当前所在微应用信息的 React hooks。\n *\n * @example\n *\n * ```tsx\n * function MyReactComponent() {\n * const app = useCurrentApp();\n * return <div>{app.id}</div>;\n * }\n * ```\n *\n * @returns 当前所在微应用的信息。\n */\nexport function useCurrentApp() {\n return useRecentApps().currentApp;\n}\n//# sourceMappingURL=useCurrentApp.js.map","import React from \"react\";\nexport function useRouteRender() {\n const [routeRender, setRouteRender] = React.useState(null);\n React.useEffect(() => {\n const listener = event => {\n setRouteRender(event.detail);\n };\n window.addEventListener(\"route.render\", listener);\n return () => window.removeEventListener(\"route.render\", listener);\n }, []);\n return routeRender;\n}\n//# sourceMappingURL=useRouteRender.js.map","export const useProviderArgsDefaults = {\n provider: \"\",\n customOptions: {\n onError: () => {\n /* Do nothing.. */\n },\n transform: (oldData, newData) => newData,\n data: undefined,\n loading: false,\n suspense: false,\n cache: true\n },\n dependencies: undefined\n};\nexport default Object.entries(useProviderArgsDefaults).reduce((acc, _ref) => {\n let [key, value] = _ref;\n if (Object.prototype.toString.call(value) === \"[object Object]\") return {\n ...acc,\n ...value\n };\n return {\n ...acc,\n [key]: value\n };\n}, {});\n//# sourceMappingURL=useProviderArgsDefaults.js.map","import { fetchByProvider } from \"@next-core/runtime\";\nconst cacheMap = new Map();\nfunction isObj(v) {\n return typeof v === \"object\" && v !== null && !Array.isArray(v);\n}\nfunction isString(v) {\n return typeof v === \"string\";\n}\nfunction buildSortedCacheKey(provider) {\n const sortObj = obj => Object.keys(obj).sort().map(k => ({\n [k]: obj[k]\n }));\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n try {\n const sortedArgs = isObj(args) ? sortObj(args) : args.map(arg => isString(arg) ? arg : sortObj(arg));\n return JSON.stringify({\n provider,\n args: sortedArgs\n });\n } catch (e) {\n return JSON.stringify({\n provider,\n args\n });\n }\n}\nexport default async function fetch(provider, cache, args) {\n let promise;\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n const cacheKey = buildSortedCacheKey(provider, ...args);\n !cache && cacheMap.has(cacheKey) && cacheMap.delete(cacheKey);\n if (cacheMap.has(cacheKey)) {\n promise = cacheMap.get(cacheKey);\n } else {\n promise = (() => {\n return fetchByProvider(provider, args);\n })();\n cache && cacheMap.set(cacheKey, promise);\n }\n return promise;\n}\n//# sourceMappingURL=fetch.js.map","import { useCallback, useEffect, useMemo, useReducer, useRef, useState } from \"react\";\nimport useProviderArgs from \"./useProviderArgs.js\";\nimport { isObject, isString } from \"lodash\";\nimport fetch from \"./fetch.js\";\nexport function useProvider() {\n const {\n provider,\n customOptions,\n dependencies,\n requestInit\n } = useProviderArgs(...arguments);\n const {\n onError,\n transform,\n suspense,\n cache,\n ...defaults\n } = customOptions;\n const [loading, setLoading] = useState(defaults.loading);\n const suspenseStatus = useRef(\"pending\");\n const suspender = useRef();\n const mounted = useRef(false);\n const error = useRef();\n const response = useRef();\n const data = useRef(defaults.data);\n const forceUpdate = useReducer(() => ({}), [])[1];\n const doFetch = useCallback(async (provider, providerArgs) => {\n try {\n error.current = undefined;\n if (!suspense) setLoading(true);\n const newRes = await fetch(provider, cache, providerArgs);\n response.current = newRes;\n data.current = transform(data.current, newRes);\n } catch (e) {\n error.current = e;\n data.current = undefined;\n }\n if (!suspense) setLoading(false);\n if (error.current) onError(error.current);\n return data.current;\n }, [provider, customOptions, dependencies, requestInit, suspense, transform, defaults.data, onError, cache]);\n const makeFetch = useCallback(async (providerOrBody, args) => {\n let providerStr = provider;\n let providerArgs = [];\n if (isString(providerOrBody)) {\n providerStr = providerOrBody;\n }\n if (isObject(providerOrBody)) {\n providerArgs = providerOrBody;\n } else if (isObject(args)) {\n providerArgs = args;\n }\n if (suspense) {\n return (async () => {\n suspender.current = doFetch(providerStr, providerArgs).then(newData => {\n suspenseStatus.current = \"success\";\n return newData;\n }, error => {\n /* istanbul ignore next */\n suspenseStatus.current = \"error\";\n error.current = error;\n return error;\n });\n forceUpdate();\n return await suspender.current;\n })();\n }\n return doFetch(providerStr, providerArgs);\n }, [doFetch]);\n const request = useMemo(() => Object.defineProperties({\n query: makeFetch\n }, {\n loading: {\n get() {\n return loading;\n }\n },\n data: {\n get() {\n return data.current;\n }\n },\n error: {\n get() {\n return error.current;\n }\n }\n }), [makeFetch]);\n\n // onMount/onUpdate\n useEffect(() => {\n mounted.current = true;\n if (Array.isArray(dependencies) && provider) {\n request.query(provider, requestInit.args);\n }\n return () => mounted.current = false;\n }, dependencies);\n if (suspense && suspender.current) {\n switch (suspenseStatus.current) {\n case \"pending\":\n throw suspender.current;\n /* istanbul ignore next */\n case \"error\":\n throw error.current;\n }\n }\n return Object.assign([request, response.current, loading, error.current], {\n request,\n ...request,\n response: response.current,\n data: data.current,\n loading,\n error: error.current\n });\n}\n//# sourceMappingURL=useProvider.js.map","import { useMemo } from \"react\";\nimport defaults, { useProviderArgsDefaults } from \"./useProviderArgsDefaults.js\";\nimport { isObject } from \"lodash\";\nexport default function useProviderArgs(providerOrParamsOrGlobalOptions, globalOptionsOrDeps, deps) {\n const provider = useMemo(() => {\n if (typeof providerOrParamsOrGlobalOptions === \"string\") {\n return providerOrParamsOrGlobalOptions;\n }\n return useProviderArgsDefaults.provider;\n }, [providerOrParamsOrGlobalOptions, globalOptionsOrDeps]);\n const options = useMemo(() => {\n let localOptions = {};\n if (isObject(providerOrParamsOrGlobalOptions)) {\n localOptions = providerOrParamsOrGlobalOptions;\n } else if (isObject(globalOptionsOrDeps)) {\n localOptions = globalOptionsOrDeps;\n }\n return {\n ...defaults,\n ...localOptions\n };\n }, [providerOrParamsOrGlobalOptions, globalOptionsOrDeps]);\n const requestInit = useMemo(() => {\n const customOptionKeys = [...Object.keys(useProviderArgsDefaults), ...Object.keys(useProviderArgsDefaults.customOptions)];\n const {\n args = null,\n ...restOptions\n } = Object.keys(options).reduce((acc, key) => {\n if (!customOptionKeys.includes(key)) acc[key] = options[key];\n return acc;\n }, {});\n return {\n options: {\n ...restOptions\n },\n args\n };\n }, [options]);\n const dependencies = useMemo(() => {\n if (Array.isArray(globalOptionsOrDeps)) return globalOptionsOrDeps;\n if (Array.isArray(deps)) return deps;\n return defaults.dependencies;\n }, [globalOptionsOrDeps, deps]);\n const loading = options.loading || Array.isArray(dependencies);\n const customOptions = useMemo(() => {\n const customOptionKeys = Object.keys(useProviderArgsDefaults.customOptions);\n const customOptions = customOptionKeys.reduce((opts, key) => {\n opts[key] = options[key];\n return opts;\n }, {});\n return {\n ...customOptions,\n loading\n };\n }, [options]);\n return {\n provider,\n customOptions,\n requestInit,\n dependencies\n };\n}\n//# sourceMappingURL=useProviderArgs.js.map","import { __secret_internals } from \"@next-core/runtime\";\nimport { wrapBrick } from \"@next-core/react-element\";\n\n/**\n * 使用异步加载的方式包装一个构件,可用于按条件渲染的构件依赖。\n *\n * 例如提供复杂弹层内容的按钮构件,其内容需要使用到一些大型构件,那么这些依赖可以使用 asyncWrapBrick,\n * 这样只有在需要时才会加载这些依赖的构件。\n */\n\n/**\n * 使用异步加载的方式包装一个构件,可用于按条件渲染的构件依赖。\n *\n * 例如提供复杂弹层内容的按钮构件,其内容需要使用到一些大型构件,那么这些依赖可以使用 asyncWrapBrick,\n * 这样只有在需要时才会加载这些依赖的构件。\n */\n\nexport async function asyncWrapBrick(brickName, eventsMapping) {\n await __secret_internals.loadBricks([brickName]);\n return wrapBrick(brickName, eventsMapping);\n}\n//# sourceMappingURL=asyncWrapBrick.js.map","import { useEffect, useState } from \"react\";\nimport { getRuntime } from \"@next-core/runtime\";\nexport function useNavConfig() {\n const [navConfig, setNavConfig] = useState(() => getRuntime().getNavConfig());\n useEffect(() => {\n const listener = event => {\n setNavConfig(event.detail);\n };\n window.addEventListener(\"navConfig.change\", listener);\n return () => window.removeEventListener(\"navConfig.change\", listener);\n }, []);\n return navConfig;\n}\n//# sourceMappingURL=useNavConfig.js.map","import { lazy, useMemo } from \"react\";\nimport { asyncWrapBrick } from \"./asyncWrapBrick.js\";\n\n/**\n * 使用 `React.lazy` 包装一个异步加载的构件。\n *\n * ```jsx\n * const DepComponent = useLazyWrapBrick(\"async-dep\");\n * return (\n * <Suspense fallback=\"Loading...\">\n * <DepComponent {...props} />\n * </Suspense>\n * );\n * ```\n */\n\n/**\n * 使用 `React.lazy` 包装一个异步加载的构件。\n *\n * ```jsx\n * const DepComponent = useLazyWrapBrick(\"async-dep\");\n * return (\n * <Suspense fallback=\"Loading...\">\n * <DepComponent {...props} />\n * </Suspense>\n * );\n * ```\n */\n\n/**\n * 使用 `React.lazy` 包装一个异步加载的构件。\n *\n * ```jsx\n * const DepComponent = useLazyWrapBrick(\"async-dep\");\n * return (\n * <Suspense fallback=\"Loading...\">\n * <DepComponent {...props} />\n * </Suspense>\n * );\n * ```\n */\n\n/**\n * 使用 `React.lazy` 包装一个异步加载的构件。\n *\n * ```jsx\n * const DepComponent = useLazyWrapBrick(\"async-dep\");\n * return (\n * <Suspense fallback=\"Loading...\">\n * <DepComponent {...props} />\n * </Suspense>\n * );\n * ```\n */\n\nexport function useLazyWrapBrick(brickName, eventsMapping) {\n return useMemo(() => {\n if (brickName != null) {\n return /*#__PURE__*/lazy(async () => ({\n default: await asyncWrapBrick(brickName, eventsMapping)\n }));\n }\n return null;\n }, [brickName, eventsMapping]);\n}\n//# sourceMappingURL=useLazyWrapBrick.js.map"],"names":["ReactUseBrick","_ref","useBrick","data","errorBoundary","refCallback","ignoredCallback","renderResult","setRenderResult","useState","mountResult","useRef","renderKey","setRenderKey","IdCounterRef","initialRenderId","useMemo","_secret_internals$ge","__secret_internals","getRenderId","call","useEffect","ignore","async","newRender","renderUseBrick","current","error","_secret_internals$ge2","newRenderId","isTheSameRender","console","handleHttpError","init","_refCallback","useCallback","element","mountUseBrick","unmountUseBrick","undefined","tagName","WebComponent","key","ref","ReactUseMultipleBricks","_ref2","Array","isArray","map","item","index","v2Kit","getV2RuntimeFromDll","SingleBrickAsComponentFactory","BrickAsComponentFactory","useCurrentTheme","currentTheme","setCurrentTheme","getCurrentTheme","listenToThemeChange","event","detail","window","addEventListener","removeEventListener","useRecentApps","recentApps","setRecentApps","getRuntime","getRecentApps","listener","useCurrentApp","currentApp","useRouteRender","routeRender","setRouteRender","useProviderArgsDefaults","provider","customOptions","onError","transform","oldData","newData","loading","suspense","cache","dependencies","Object","entries","reduce","acc","value","prototype","toString","cacheMap","Map","useProvider","requestInit","providerOrParamsOrGlobalOptions","globalOptionsOrDeps","deps","options","localOptions","isObject","customOptionKeys","keys","args","restOptions","includes","opts","useProviderArgs","arguments","defaults","setLoading","suspenseStatus","suspender","mounted","response","forceUpdate","useReducer","doFetch","providerArgs","newRes","promise","cacheKey","sortObj","obj","sort","k","_len","length","_key","sortedArgs","v","arg","isString","JSON","stringify","e","buildSortedCacheKey","has","delete","get","fetchByProvider","set","fetch","makeFetch","providerOrBody","providerStr","then","request","defineProperties","query","assign","asyncWrapBrick","brickName","eventsMapping","loadBricks","wrapBrick","useNavConfig","navConfig","setNavConfig","getNavConfig","useLazyWrapBrick","lazy","default"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"chunks/7218.30573c75.js","mappings":"wZAIA,IAAIA,EAAgB,SAAuBC,GACzC,IAAI,SACFC,EAAQ,KACRC,EAAI,cACJC,EAAa,YACbC,EAAW,gBACXC,GACEL,EACJ,MAAOM,EAAcC,IAAmB,IAAAC,UAAS,MAC3CC,GAAc,IAAAC,WACbC,EAAWC,IAAgB,IAAAJ,YAC5BK,GAAe,IAAAH,Q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AAMD,YAGf,CAACwH,IAUL,IAPA,IAAA7H,YAAU,KACR+F,EAAQ1F,SAAU,EACdoB,MAAMC,QAAQuC,IAAiBT,GACjCyE,EAAQE,MAAM3E,EAAUoB,EAAYS,MAE/B,IAAMU,EAAQ1F,SAAU,IAC9B4D,GACCF,GAAY+B,EAAUzF,QACxB,OAAQwF,EAAexF,SACrB,IAAK,UACH,MAAMyF,EAAUzF,QAElB,IAAK,QACH,MAAMC,EAAMD,QAGlB,OAAO6D,OAAOkE,OAAO,CAACH,EAASjC,EAAS3F,QAASyD,EAASxD,EAAMD,SAAU,CACxE4H,aACGA,EACHjC,SAAUA,EAAS3F,QACnBvB,KAAMA,EAAKuB,QACXyD,UACAxD,MAAOA,EAAMD,SAEjB,C,cEjGOH,eAAemI,EAAeC,EAAWC,GAE9C,aADM,EAAA1I,mBAAmB2I,WAAW,CAACF,KAC9B,IAAAG,WAAUH,EAAWC,EAC9B,CClBO,SAASG,IACd,MAAOC,EAAWC,IAAgB,IAAAxJ,WAAS,KAAM,IAAA2D,cAAa8F,iBAQ9D,OAPA,IAAA7I,YAAU,KACR,MAAMiD,EAAWV,IACfqG,EAAarG,EAAMC,OAAO,EAG5B,OADAC,OAAOC,iBAAiB,mBAAoBO,GACrC,IAAMR,OAAOE,oBAAoB,mBAAoBM,EAAS,GACpE,IACI0F,CACT,CC2CO,SAASG,EAAiBR,EAAWC,GAC1C,OAAO,IAAA5I,UAAQ,IACI,MAAb2I,GACkB,IAAAS,OAAK7I,UAAY,CACnC8I,cAAeX,EAAeC,EAAWC,OAGtC,MACN,CAACD,EAAWC,GACjB,C","sources":["webpack:///../../node_modules/@next-core/react-runtime/dist/esm/ReactUseBrick.js","webpack:///../../node_modules/@next-core/react-runtime/dist/esm/useCurrentTheme.js","webpack:///../../node_modules/@next-core/react-runtime/dist/esm/useRecentApps.js","webpack:///../../node_modules/@next-core/react-runtime/dist/esm/useCurrentApp.js","webpack:///../../node_modules/@next-core/react-runtime/dist/esm/useRouteRender.js","webpack:///../../node_modules/@next-core/react-runtime/dist/esm/useProvider/useProviderArgsDefaults.js","webpack:///../../node_modules/@next-core/react-runtime/dist/esm/useProvider/fetch.js","webpack:///../../node_modules/@next-core/react-runtime/dist/esm/useProvider/useProvider.js","webpack:///../../node_modules/@next-core/react-runtime/dist/esm/useProvider/useProviderArgs.js","webpack:///../../node_modules/@next-core/react-runtime/dist/esm/asyncWrapBrick.js","webpack:///../../node_modules/@next-core/react-runtime/dist/esm/useNavConfig.js","webpack:///../../node_modules/@next-core/react-runtime/dist/esm/useLazyWrapBrick.js"],"sourcesContent":["import React, { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport { __secret_internals, handleHttpError, getV2RuntimeFromDll } from \"@next-core/runtime\";\n// Note: always synchronize code in LegacyUseBrick:\n// `bricks/v2-adapter/src/data-providers/legacy-brick-kit/getLegacyUseBrick.ts`\nlet ReactUseBrick = function ReactUseBrick(_ref) {\n let {\n useBrick,\n data,\n errorBoundary,\n refCallback,\n ignoredCallback\n } = _ref;\n const [renderResult, setRenderResult] = useState(null);\n const mountResult = useRef();\n const [renderKey, setRenderKey] = useState();\n const IdCounterRef = useRef(0);\n const initialRenderId = useMemo(() => {\n var _secret_internals$ge;\n return (_secret_internals$ge = __secret_internals.getRenderId) === null || _secret_internals$ge === void 0 ? void 0 : _secret_internals$ge.call(__secret_internals);\n }, []);\n useEffect(() => {\n let ignore = false;\n async function init() {\n try {\n const newRender = await __secret_internals.renderUseBrick(useBrick, data, errorBoundary);\n if (ignore) {\n return;\n }\n setRenderResult(newRender);\n setRenderKey(getUniqueId(IdCounterRef));\n } catch (error) {\n if (!ignore && isTheSameRender(initialRenderId)) {\n // eslint-disable-next-line no-console\n console.error(\"Render useBrick failed:\", useBrick, \"with data:\", data);\n handleHttpError(error);\n }\n }\n }\n init();\n return () => {\n ignore = true;\n };\n }, [data, useBrick, initialRenderId, errorBoundary]);\n const _refCallback = useCallback(element => {\n if (element) {\n mountResult.current = __secret_internals.mountUseBrick(\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n renderResult, element);\n } else {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n __secret_internals.unmountUseBrick(renderResult, mountResult.current);\n mountResult.current = undefined;\n }\n refCallback === null || refCallback === void 0 || refCallback(element);\n }, [refCallback, renderResult]);\n if (!renderResult) {\n // Fallback when loading/\n return null;\n // return <span>🌀 Loading...</span>;\n }\n const {\n tagName\n } = renderResult;\n if (tagName === null) {\n ignoredCallback === null || ignoredCallback === void 0 || ignoredCallback();\n return null;\n }\n const WebComponent = tagName;\n return /*#__PURE__*/React.createElement(WebComponent, {\n key: renderKey,\n ref: _refCallback\n });\n};\nfunction getUniqueId(ref) {\n return ++ref.current;\n}\nfunction isTheSameRender(initialRenderId) {\n var _secret_internals$ge2;\n const newRenderId = (_secret_internals$ge2 = __secret_internals.getRenderId) === null || _secret_internals$ge2 === void 0 ? void 0 : _secret_internals$ge2.call(__secret_internals);\n return !initialRenderId || !newRenderId || initialRenderId === newRenderId;\n}\nlet ReactUseMultipleBricks = function ReactUseMultipleBricks(_ref2) {\n let {\n useBrick,\n data,\n errorBoundary\n } = _ref2;\n if (Array.isArray(useBrick)) {\n return /*#__PURE__*/React.createElement(React.Fragment, null, useBrick.map((item, index) => /*#__PURE__*/React.createElement(ReactUseBrick, {\n key: index,\n useBrick: item,\n data: data,\n errorBoundary: errorBoundary\n })));\n }\n return /*#__PURE__*/React.createElement(ReactUseBrick, {\n useBrick: useBrick,\n data: data,\n errorBoundary: errorBoundary\n });\n};\n\n// Make v3 bricks compatible with Brick Next v2.\n// istanbul ignore next\nconst v2Kit = getV2RuntimeFromDll();\n// istanbul ignore next\nif (v2Kit) {\n const {\n SingleBrickAsComponentFactory,\n BrickAsComponentFactory\n } = v2Kit;\n if (SingleBrickAsComponentFactory && BrickAsComponentFactory) {\n ReactUseBrick = SingleBrickAsComponentFactory(React);\n ReactUseMultipleBricks = BrickAsComponentFactory(React);\n }\n}\nexport { ReactUseBrick, ReactUseMultipleBricks };\n//# sourceMappingURL=ReactUseBrick.js.map","import { useEffect, useState } from \"react\";\nimport { getCurrentTheme } from \"@next-core/runtime\";\nexport function useCurrentTheme() {\n const [currentTheme, setCurrentTheme] = useState(getCurrentTheme);\n useEffect(() => {\n const listenToThemeChange = event => {\n setCurrentTheme(event.detail);\n };\n window.addEventListener(\"theme.change\", listenToThemeChange);\n return () => {\n window.removeEventListener(\"theme.change\", listenToThemeChange);\n };\n }, []);\n return currentTheme;\n}\n//# sourceMappingURL=useCurrentTheme.js.map","import React from \"react\";\nimport { getRuntime } from \"@next-core/runtime\";\nexport function useRecentApps() {\n const [recentApps, setRecentApps] = React.useState(() => getRuntime().getRecentApps());\n React.useEffect(() => {\n const listener = event => {\n setRecentApps(event.detail);\n };\n window.addEventListener(\"app.change\", listener);\n return () => window.removeEventListener(\"app.change\", listener);\n }, []);\n return recentApps;\n}\n//# sourceMappingURL=useRecentApps.js.map","import { useRecentApps } from \"./useRecentApps.js\";\n\n/**\n * 获取当前所在微应用信息的 React hooks。\n *\n * @example\n *\n * ```tsx\n * function MyReactComponent() {\n * const app = useCurrentApp();\n * return <div>{app.id}</div>;\n * }\n * ```\n *\n * @returns 当前所在微应用的信息。\n */\nexport function useCurrentApp() {\n return useRecentApps().currentApp;\n}\n//# sourceMappingURL=useCurrentApp.js.map","import React from \"react\";\nexport function useRouteRender() {\n const [routeRender, setRouteRender] = React.useState(null);\n React.useEffect(() => {\n const listener = event => {\n setRouteRender(event.detail);\n };\n window.addEventListener(\"route.render\", listener);\n return () => window.removeEventListener(\"route.render\", listener);\n }, []);\n return routeRender;\n}\n//# sourceMappingURL=useRouteRender.js.map","export const useProviderArgsDefaults = {\n provider: \"\",\n customOptions: {\n onError: () => {\n /* Do nothing.. */\n },\n transform: (oldData, newData) => newData,\n data: undefined,\n loading: false,\n suspense: false,\n cache: true\n },\n dependencies: undefined\n};\nexport default Object.entries(useProviderArgsDefaults).reduce((acc, _ref) => {\n let [key, value] = _ref;\n if (Object.prototype.toString.call(value) === \"[object Object]\") return {\n ...acc,\n ...value\n };\n return {\n ...acc,\n [key]: value\n };\n}, {});\n//# sourceMappingURL=useProviderArgsDefaults.js.map","import { fetchByProvider } from \"@next-core/runtime\";\nconst cacheMap = new Map();\nfunction isObj(v) {\n return typeof v === \"object\" && v !== null && !Array.isArray(v);\n}\nfunction isString(v) {\n return typeof v === \"string\";\n}\nfunction buildSortedCacheKey(provider) {\n const sortObj = obj => Object.keys(obj).sort().map(k => ({\n [k]: obj[k]\n }));\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n try {\n const sortedArgs = isObj(args) ? sortObj(args) : args.map(arg => isString(arg) ? arg : sortObj(arg));\n return JSON.stringify({\n provider,\n args: sortedArgs\n });\n } catch (e) {\n return JSON.stringify({\n provider,\n args\n });\n }\n}\nexport default async function fetch(provider, cache, args) {\n let promise;\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n const cacheKey = buildSortedCacheKey(provider, ...args);\n !cache && cacheMap.has(cacheKey) && cacheMap.delete(cacheKey);\n if (cacheMap.has(cacheKey)) {\n promise = cacheMap.get(cacheKey);\n } else {\n promise = (() => {\n return fetchByProvider(provider, args);\n })();\n cache && cacheMap.set(cacheKey, promise);\n }\n return promise;\n}\n//# sourceMappingURL=fetch.js.map","import { useCallback, useEffect, useMemo, useReducer, useRef, useState } from \"react\";\nimport useProviderArgs from \"./useProviderArgs.js\";\nimport { isObject, isString } from \"lodash\";\nimport fetch from \"./fetch.js\";\nexport function useProvider() {\n const {\n provider,\n customOptions,\n dependencies,\n requestInit\n } = useProviderArgs(...arguments);\n const {\n onError,\n transform,\n suspense,\n cache,\n ...defaults\n } = customOptions;\n const [loading, setLoading] = useState(defaults.loading);\n const suspenseStatus = useRef(\"pending\");\n const suspender = useRef();\n const mounted = useRef(false);\n const error = useRef();\n const response = useRef();\n const data = useRef(defaults.data);\n const forceUpdate = useReducer(() => ({}), [])[1];\n const doFetch = useCallback(async (provider, providerArgs) => {\n try {\n error.current = undefined;\n if (!suspense) setLoading(true);\n const newRes = await fetch(provider, cache, providerArgs);\n response.current = newRes;\n data.current = transform(data.current, newRes);\n } catch (e) {\n error.current = e;\n data.current = undefined;\n }\n if (!suspense) setLoading(false);\n if (error.current) onError(error.current);\n return data.current;\n }, [provider, customOptions, dependencies, requestInit, suspense, transform, defaults.data, onError, cache]);\n const makeFetch = useCallback(async (providerOrBody, args) => {\n let providerStr = provider;\n let providerArgs = [];\n if (isString(providerOrBody)) {\n providerStr = providerOrBody;\n }\n if (isObject(providerOrBody)) {\n providerArgs = providerOrBody;\n } else if (isObject(args)) {\n providerArgs = args;\n }\n if (suspense) {\n return (async () => {\n suspender.current = doFetch(providerStr, providerArgs).then(newData => {\n suspenseStatus.current = \"success\";\n return newData;\n }, error => {\n /* istanbul ignore next */\n suspenseStatus.current = \"error\";\n error.current = error;\n return error;\n });\n forceUpdate();\n return await suspender.current;\n })();\n }\n return doFetch(providerStr, providerArgs);\n }, [doFetch]);\n const request = useMemo(() => Object.defineProperties({\n query: makeFetch\n }, {\n loading: {\n get() {\n return loading;\n }\n },\n data: {\n get() {\n return data.current;\n }\n },\n error: {\n get() {\n return error.current;\n }\n }\n }), [makeFetch]);\n\n // onMount/onUpdate\n useEffect(() => {\n mounted.current = true;\n if (Array.isArray(dependencies) && provider) {\n request.query(provider, requestInit.args);\n }\n return () => mounted.current = false;\n }, dependencies);\n if (suspense && suspender.current) {\n switch (suspenseStatus.current) {\n case \"pending\":\n throw suspender.current;\n /* istanbul ignore next */\n case \"error\":\n throw error.current;\n }\n }\n return Object.assign([request, response.current, loading, error.current], {\n request,\n ...request,\n response: response.current,\n data: data.current,\n loading,\n error: error.current\n });\n}\n//# sourceMappingURL=useProvider.js.map","import { useMemo } from \"react\";\nimport defaults, { useProviderArgsDefaults } from \"./useProviderArgsDefaults.js\";\nimport { isObject } from \"lodash\";\nexport default function useProviderArgs(providerOrParamsOrGlobalOptions, globalOptionsOrDeps, deps) {\n const provider = useMemo(() => {\n if (typeof providerOrParamsOrGlobalOptions === \"string\") {\n return providerOrParamsOrGlobalOptions;\n }\n return useProviderArgsDefaults.provider;\n }, [providerOrParamsOrGlobalOptions, globalOptionsOrDeps]);\n const options = useMemo(() => {\n let localOptions = {};\n if (isObject(providerOrParamsOrGlobalOptions)) {\n localOptions = providerOrParamsOrGlobalOptions;\n } else if (isObject(globalOptionsOrDeps)) {\n localOptions = globalOptionsOrDeps;\n }\n return {\n ...defaults,\n ...localOptions\n };\n }, [providerOrParamsOrGlobalOptions, globalOptionsOrDeps]);\n const requestInit = useMemo(() => {\n const customOptionKeys = [...Object.keys(useProviderArgsDefaults), ...Object.keys(useProviderArgsDefaults.customOptions)];\n const {\n args = null,\n ...restOptions\n } = Object.keys(options).reduce((acc, key) => {\n if (!customOptionKeys.includes(key)) acc[key] = options[key];\n return acc;\n }, {});\n return {\n options: {\n ...restOptions\n },\n args\n };\n }, [options]);\n const dependencies = useMemo(() => {\n if (Array.isArray(globalOptionsOrDeps)) return globalOptionsOrDeps;\n if (Array.isArray(deps)) return deps;\n return defaults.dependencies;\n }, [globalOptionsOrDeps, deps]);\n const loading = options.loading || Array.isArray(dependencies);\n const customOptions = useMemo(() => {\n const customOptionKeys = Object.keys(useProviderArgsDefaults.customOptions);\n const customOptions = customOptionKeys.reduce((opts, key) => {\n opts[key] = options[key];\n return opts;\n }, {});\n return {\n ...customOptions,\n loading\n };\n }, [options]);\n return {\n provider,\n customOptions,\n requestInit,\n dependencies\n };\n}\n//# sourceMappingURL=useProviderArgs.js.map","import { __secret_internals } from \"@next-core/runtime\";\nimport { wrapBrick } from \"@next-core/react-element\";\n\n/**\n * 使用异步加载的方式包装一个构件,可用于按条件渲染的构件依赖。\n *\n * 例如提供复杂弹层内容的按钮构件,其内容需要使用到一些大型构件,那么这些依赖可以使用 asyncWrapBrick,\n * 这样只有在需要时才会加载这些依赖的构件。\n */\n\n/**\n * 使用异步加载的方式包装一个构件,可用于按条件渲染的构件依赖。\n *\n * 例如提供复杂弹层内容的按钮构件,其内容需要使用到一些大型构件,那么这些依赖可以使用 asyncWrapBrick,\n * 这样只有在需要时才会加载这些依赖的构件。\n */\n\nexport async function asyncWrapBrick(brickName, eventsMapping) {\n await __secret_internals.loadBricks([brickName]);\n return wrapBrick(brickName, eventsMapping);\n}\n//# sourceMappingURL=asyncWrapBrick.js.map","import { useEffect, useState } from \"react\";\nimport { getRuntime } from \"@next-core/runtime\";\nexport function useNavConfig() {\n const [navConfig, setNavConfig] = useState(() => getRuntime().getNavConfig());\n useEffect(() => {\n const listener = event => {\n setNavConfig(event.detail);\n };\n window.addEventListener(\"navConfig.change\", listener);\n return () => window.removeEventListener(\"navConfig.change\", listener);\n }, []);\n return navConfig;\n}\n//# sourceMappingURL=useNavConfig.js.map","import { lazy, useMemo } from \"react\";\nimport { asyncWrapBrick } from \"./asyncWrapBrick.js\";\n\n/**\n * 使用 `React.lazy` 包装一个异步加载的构件。\n *\n * ```jsx\n * const DepComponent = useLazyWrapBrick(\"async-dep\");\n * return (\n * <Suspense fallback=\"Loading...\">\n * <DepComponent {...props} />\n * </Suspense>\n * );\n * ```\n */\n\n/**\n * 使用 `React.lazy` 包装一个异步加载的构件。\n *\n * ```jsx\n * const DepComponent = useLazyWrapBrick(\"async-dep\");\n * return (\n * <Suspense fallback=\"Loading...\">\n * <DepComponent {...props} />\n * </Suspense>\n * );\n * ```\n */\n\n/**\n * 使用 `React.lazy` 包装一个异步加载的构件。\n *\n * ```jsx\n * const DepComponent = useLazyWrapBrick(\"async-dep\");\n * return (\n * <Suspense fallback=\"Loading...\">\n * <DepComponent {...props} />\n * </Suspense>\n * );\n * ```\n */\n\n/**\n * 使用 `React.lazy` 包装一个异步加载的构件。\n *\n * ```jsx\n * const DepComponent = useLazyWrapBrick(\"async-dep\");\n * return (\n * <Suspense fallback=\"Loading...\">\n * <DepComponent {...props} />\n * </Suspense>\n * );\n * ```\n */\n\nexport function useLazyWrapBrick(brickName, eventsMapping) {\n return useMemo(() => {\n if (brickName != null) {\n return /*#__PURE__*/lazy(async () => ({\n default: await asyncWrapBrick(brickName, eventsMapping)\n }));\n }\n return null;\n }, [brickName, eventsMapping]);\n}\n//# sourceMappingURL=useLazyWrapBrick.js.map"],"names":["ReactUseBrick","_ref","useBrick","data","errorBoundary","refCallback","ignoredCallback","renderResult","setRenderResult","useState","mountResult","useRef","renderKey","setRenderKey","IdCounterRef","initialRenderId","useMemo","_secret_internals$ge","__secret_internals","getRenderId","call","useEffect","ignore","async","newRender","renderUseBrick","current","error","_secret_internals$ge2","newRenderId","isTheSameRender","console","handleHttpError","init","_refCallback","useCallback","element","mountUseBrick","unmountUseBrick","undefined","tagName","WebComponent","key","ref","ReactUseMultipleBricks","_ref2","Array","isArray","map","item","index","v2Kit","getV2RuntimeFromDll","SingleBrickAsComponentFactory","BrickAsComponentFactory","useCurrentTheme","currentTheme","setCurrentTheme","getCurrentTheme","listenToThemeChange","event","detail","window","addEventListener","removeEventListener","useRecentApps","recentApps","setRecentApps","getRuntime","getRecentApps","listener","useCurrentApp","currentApp","useRouteRender","routeRender","setRouteRender","useProviderArgsDefaults","provider","customOptions","onError","transform","oldData","newData","loading","suspense","cache","dependencies","Object","entries","reduce","acc","value","prototype","toString","cacheMap","Map","useProvider","requestInit","providerOrParamsOrGlobalOptions","globalOptionsOrDeps","deps","options","localOptions","isObject","customOptionKeys","keys","args","restOptions","includes","opts","useProviderArgs","arguments","defaults","setLoading","suspenseStatus","suspender","mounted","response","forceUpdate","useReducer","doFetch","providerArgs","newRes","promise","cacheKey","sortObj","obj","sort","k","_len","length","_key","sortedArgs","v","arg","isString","JSON","stringify","e","buildSortedCacheKey","has","delete","get","fetchByProvider","set","fetch","makeFetch","providerOrBody","providerStr","then","request","defineProperties","query","assign","asyncWrapBrick","brickName","eventsMapping","loadBricks","wrapBrick","useNavConfig","navConfig","setNavConfig","getNavConfig","useLazyWrapBrick","lazy","default"],"sourceRoot":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";(globalThis.webpackChunk_next_bricks_visual_builder=globalThis.webpackChunk_next_bricks_visual_builder||[]).push([[9027],{6788:(e,t,o)=>{o.d(t,{b:()=>i});var n=o(3518),a=o(2153),r=o(6946);function i(e){const t=function(e){const t=new Set;return(0,a.h)(e,(e=>{switch(e.type){case"Resolvable":case"EventHandler":{var o;const n=null===(o=e.raw)||void 0===o?void 0:o.useProvider;n&&t.add(n)}}})),t}((0,r.lN)(e)),o=[];for(const e of t)e.includes("@")&&o.push(e);return o}customElements.define("visual-builder.collect-used-contracts",(0,n.createProviderClass)(i))},9027:(e,t,o)=>{o.d(t,{A:()=>D,w:()=>N});var n=o(1653),a=o(9422),r=o(6055),i=o(1030),s=o(8317),d=o.n(s);let l;function c(e){e.preventDefault(),e.stopPropagation(),function(e){const t=g(e);t.length>0&&window.parent.postMessage({sender:"previewer",type:"select-brick",iidList:t},l)}(e.composedPath())}function p(e){e.preventDefault(),e.stopPropagation()}const u=(0,i.throttle)((e=>{const t=g(e);t.length>0&&window.parent.postMessage({sender:"previewer",type:"hover-on-brick",iidList:t},l)}),100,{leading:!1});function v(e){e.preventDefault(),e.stopPropagation(),u(e.composedPath())}function h(e){e.preventDefault(),e.stopPropagation(),u(e.composedPath())}function w(e){e.preventDefault(),e.stopPropagation(),window.parent.postMessage({sender:"previewer",type:"hover-on-brick",iidList:[]},l)}function m(e){e.preventDefault(),e.stopPropagation(),function(e,t){const o=g(e);o.length>0&&window.parent.postMessage({sender:"previewer",type:"context-menu-on-brick",iidList:o,position:t},l)}(e.composedPath(),{x:e.clientX,y:e.clientY})}function g(e){const t=[];for(const o of e)o instanceof HTMLElement&&"string"==typeof o.dataset.iid&&t.push(o.dataset.iid);return t}var y=o(6788);function f(e){const t=typeof e;switch(t){case"string":case"boolean":case"number":return{type:t,value:e};case"undefined":return{type:t}}return null===e?{type:"null"}:Array.isArray(e)?{type:"array",length:e.length}:{type:"object"}}let b=!1,S=n.getHistory,I=n.matchPath,E=n.__secret_internals,L=r.flowApi,k=!1;try{var P;const e=window.dll;if(e&&null!==(P=window.BRICK_NEXT_VERSIONS)&&void 0!==P&&null!==(P=P["brick-container"])&&void 0!==P&&P.startsWith("2.")){const{getHistory:t,developHelper:o,collectDebugContract:n}=e("tYg3"),{matchPath:a}=e("A+yw");S=t,I=a,E={...o,getContextValue(e,t){let{tplStateStoreId:n}=t;return o.getContextValue(e,{tplContextId:n})},getAllContextValues(e){let{tplStateStoreId:t}=e;const n=o.getAllContextValues({tplContextId:t});return Object.fromEntries([...n].map((e=>{let[t,o]=e;return[t,o.value]})))},debugDataValue(e,t){let{tplStateStoreId:n}=t;return o.debugDataValue(e,{tplContextId:n})}},L={collectDebugContract:n},k=!0}}catch(e){console.error("Try to use v2 runtime APIs failed:",e)}let x=null,C=null;async function D(e,t){var o,r;if(b)return;b=!0;const s=t=>{window.parent.postMessage({sender:"previewer",...t},e)};let u,g,k,P;s({type:"preview-started"}),l=e;const D=(e,t,o)=>{const n=T(t);s({type:"highlight-brick",highlightType:e,outlines:n,iid:t,alias:o})};let N;t.templateId&&(N=t.settings);const R=()=>{E.updateTemplatePreviewSettings(t.appId,t.templateId,N),S().reload()},O=()=>{E.updateSnippetPreviewSettings(t.appId,JSON.parse(t.snippetData)),S().reload()},_=()=>{E.updateFormPreviewSettings(t.appId,t.formId,t.formData),S().reload()},q=S();window.addEventListener("message",(async o=>{var r,f;let{data:b,origin:I}=o;if(I===e&&b&&"preview-container"===b.sender)if("builder"===b.forwardedFor)switch(b.type){case"hover-on-brick":u=b.iid,g=b.alias,D("hover",b.iid,b.alias);break;case"hover-on-main":D("hover","#main-mount-point","root");break;case"hover-on-context":(e=>{const t=e.map((e=>T(e.iid,e.alias))).flat();s({type:"highlight-context",outlines:t})})(b.highlightNodes);break;case"select-brick":k=b.iid,P=b.alias,D("active",b.iid,b.alias);break;case"hover-on-iframe":(e=>{const t=document.elementFromPoint(e.x,e.y);if("BODY"===(null==t?void 0:t.tagName))window.parent.postMessage({sender:"previewer",type:"hover-on-main",isDirection:!0,position:{x:e.x,y:e.y}},l);else{const o=function(e){const t=[];let o=e;for(;o;)"string"==typeof o.dataset.iid&&t.push(o.dataset.iid),o=o.parentElement;return t}(t);window.parent.postMessage({sender:"previewer",type:"hover-on-brick",iidList:o,isDirection:!0,position:{x:e.x,y:e.y}},l)}})(b.position)}else switch(b.type){case"toggle-inspecting":b.enabled?(window.addEventListener("click",c,!0),window.addEventListener("mousedown",p,!0),window.addEventListener("mouseover",p,!0),window.addEventListener("mouseup",p,!0),window.addEventListener("pointerdown",v,!0),window.addEventListener("pointermove",h,!0),window.addEventListener("pointerup",p,!0),window.addEventListener("pointerleave",w,!0),window.addEventListener("contextmenu",m,!0)):(window.removeEventListener("click",c,!0),window.removeEventListener("mousedown",p,!0),window.removeEventListener("mouseover",p,!0),window.removeEventListener("mouseup",p,!0),window.removeEventListener("pointerdown",v,!0),window.removeEventListener("pointermove",h,!0),window.removeEventListener("pointerup",p,!0),window.removeEventListener("pointerleave",w,!0),window.removeEventListener("contextmenu",m,!0));break;case"refresh":if(null!==(r=b.options)&&void 0!==r&&r.updateStoryboardType){var x;let e;var C,M;"route"===b.options.updateStoryboardType?E.updateStoryboardByRoute(t.appId,b.storyboardPatch):"template"===b.options.updateStoryboardType?E.updateStoryboardByTemplate(t.appId,b.storyboardPatch,b.options.settings):"snippet"===b.options.updateStoryboardType?E.updateStoryboardBySnippet(t.appId,b.storyboardPatch):"form"===b.options.updateStoryboardType&&E.updateFormPreviewSettings(t.appId,t.formId,b.storyboardPatch),"form"!==(null===(x=b.options)||void 0===x?void 0:x.updateStoryboardType)&&(e=await(null===(C=(M=E).getAddedContracts)||void 0===C?void 0:C.call(M,b.storyboardPatch,{appId:t.appId,updateStoryboardType:b.options.updateStoryboardType,formId:t.formId,collectUsedContracts:y.b}))),(0,i.isEmpty)(e)?S().reload():s({type:"contract-update",data:{add:e}});break}E.updateStoryboard(t.appId,b.storyboardPatch),t.templateId?(N=b.settings,R()):t.formId||t.formData?_():null!==(f=b.options)&&void 0!==f&&f.snippetData?(t.snippetData=b.options.snippetData,O()):S().reload();break;case"reload":location.reload();break;case"back":q.goBack();break;case"forward":q.goForward();break;case"capture":(async function(e,t){const o=await d()(document.body,{logging:!1,scale:1,width:window.innerWidth,height:window.innerHeight,foreignObjectRendering:!0}),n=document.createElement("canvas");var a;return function(e,t,o,n){const a=o/n,{width:r,height:i}=e,s=r/i,d=s>=a,l=d?o:n*s,c=d?o/s:n;t.width=l,t.height=c,t.getContext("2d").drawImage(e,0,0,r,i,0,0,l,c),t.toDataURL()}(o,n,e,t),await(a=n,new Promise((function(e,t){a.toBlob((function(o){o?e(o):t()}))})))})(b.maxWidth,b.maxHeight).then((e=>{s({type:"capture-ok",screenshot:e})}),(()=>{s({type:"capture-failed"})}));break;case"inspect-data-value":((e,t)=>{try{const{dataType:o}=t;let n,a,r;if("state"===o&&(n=A(),!n))return void s({type:"inspect-data-value-error",data:{error:{message:"tplStateStoreId not found, unable to preview STATE value"}}});if(e)r="inspect-single-data-value-success",a=E.getContextValue(e,{tplStateStoreId:n});else{r="inspect-all-data-values-success";const e=E.getAllContextValues({tplStateStoreId:n});a=Object.entries(e).map((e=>{let[t,o]=e;return{name:t,value:o}}))}s({type:r,data:{name:e,value:a}})}catch(e){s({type:"inspect-data-value-error",data:{message:e.message}})}})(b.name,b.option);break;case"update-preview-url":{const e=b.previewUrl.startsWith(window.origin)?b.previewUrl.substring(window.origin.length):b.previewUrl,t=(0,n.getBasePath)(),o=e.startsWith(t)?e.substring(t.length-1):e;S().push(o);break}case"update-preview-route":t.routePath=b.routePath,t.routeExact=b.routeExact,B();break;case"debug-data-value":(async(e,o,n)=>{try{o&&L.collectDebugContract([o]);const a=await E.debugDataValue(e,{tplStateStoreId:"state"===n.dataType?A():void 0,routeId:t.routeId});s({type:"debug-data-value-success",data:{debugConf:e,value:a}})}catch(e){s({type:"debug-data-value-error",data:e instanceof a.HttpResponseError?e.responseJson:{message:e.message}})}})(b.debugData,b.contractData,b.options)}})),window.addEventListener("scroll",(()=>{s({type:"scroll",scroll:{x:window.scrollX,y:window.scrollY}})}));let M,H=!0;const V=e=>{s({type:"url-change",url:location.origin+q.createHref(e)}),M=e,B()};function B(){if(t.routePath){const e=!!I(M.pathname,{path:t.routePath,exact:t.routeExact});if(s({type:"route-match-change",match:e}),t.templateId&&!H&&e){const e=document.querySelector("#main-mount-point"),t=new MutationObserver((()=>{1===e.childNodes.length&&"SPAN"===e.firstChild.tagName&&0===e.firstChild.childNodes.length&&(R(),t.disconnect())}));t.observe(e,{childList:!0})}if(t.formId&&!H&&e){const e=document.querySelector("#main-mount-point"),t=new MutationObserver((()=>{1===e.childNodes.length&&"SPAN"===e.firstChild.tagName&&0===e.firstChild.childNodes.length&&(_(),t.disconnect())}));t.observe(e,{childList:!0})}if(t.snippetData&&!H&&e){const e=document.querySelector("#main-mount-point"),t=new MutationObserver((()=>{1===e.childNodes.length&&"SPAN"===e.firstChild.tagName&&0===e.firstChild.childNodes.length&&(O(),t.disconnect())}));t.observe(e,{childList:!0})}H=e}}function j(){var e;const t=document.querySelector("eo-page-view"),o=(null==t||null===(e=t.shadowRoot)||void 0===e?void 0:e.querySelector(".content"))??null;var n;o!==x&&(null===(n=x)||void 0===n||n.removeEventListener("scroll",F),null==o||o.addEventListener("scroll",F),x=o,C=t)}function F(){s({type:"content-scroll",scroll:{x:this.scrollLeft,y:this.scrollTop}})}V(q.location),q.listen(V),t.templateId&&R(),(t.formId||t.formData)&&_(),t.snippetData&&O();const U=()=>{var e;const o=t.routeId,n=E.getLegalRuntimeValue({routeId:o});s({type:"inspect-runtime-data-value",data:{...(0,i.omit)(n,"query"),query:n.query?Object.fromEntries(n.query.entries()):{},path:null===(e=n.match)||void 0===e?void 0:e.params}})};let W;function Y(e){const o=t.templateId?A():void 0;var n,a;(W!==o||e)&&(W=o,null===(n=(a=E).setRealTimeDataInspectRoot)||void 0===n||n.call(a,{tplStateStoreId:o}))}null===(o=(r=E).addRealTimeDataInspectHook)||void 0===o||o.call(r,(e=>{let{changeType:t,tplStateStoreId:o,detail:n}=e;s({type:"real-time-data-inspect-change",changeType:t,tplStateStoreId:o,detail:"update"===t?{name:n.name,annotation:f(n.value)}:{data:Object.fromEntries(Object.entries(n.data).map((e=>{let[t,o]=e;return[t,f(o)]})))}})})),window.addEventListener("route.render",(()=>{Y(!0),U()})),j(),Y(!0),U(),new MutationObserver((0,i.throttle)((()=>{j(),Y(),u&&D("hover",u,g),k&&D("active",k,P)}),100,{leading:!1})).observe(document.body,{subtree:!0,childList:!0})}function T(e,t){if(!e)return[];const o=e.includes("#"),n=function(e,t){return e.map((e=>{var o;const n=null===(o=C)||void 0===o?void 0:o.contains(e),{width:a,height:r,left:i,top:s}=e.getBoundingClientRect();return{width:a,height:r,left:i+window.scrollX+(n?x.scrollLeft:0),top:s+window.scrollY+(n?x.scrollTop:0),alias:t,hasContentScroll:n}}))}(N(e,o),t);return o?n.map((e=>({...e,height:window.innerHeight-e.top}))):n}function N(e,t){const o=[];return function n(a){const r=a.querySelectorAll(t?e:`[data-iid="${e}"]`);if(o.push(...r),!(a===document&&r.length>0))for(const e of a.querySelectorAll("*"))e.shadowRoot&&n(e.shadowRoot)}(document),o}function A(){var e;const t=document.querySelector("#main-mount-point");return null==t||null===(e=t.firstChild)||void 0===e?void 0:e.dataset[k?"tplContextId":"tplStateStoreId"]}}}]);
|
|
2
|
-
//# sourceMappingURL=9027.
|
|
1
|
+
"use strict";(globalThis.webpackChunk_next_bricks_visual_builder=globalThis.webpackChunk_next_bricks_visual_builder||[]).push([[9027],{6788:(e,t,o)=>{o.d(t,{b:()=>i});var n=o(3518),a=o(2153),r=o(6946);function i(e){const t=function(e){const t=new Set;return(0,a.h)(e,(e=>{switch(e.type){case"Resolvable":case"EventHandler":{var o;const n=null===(o=e.raw)||void 0===o?void 0:o.useProvider;n&&t.add(n)}}})),t}((0,r.lN)(e)),o=[];for(const e of t)e.includes("@")&&o.push(e);return o}customElements.define("visual-builder.collect-used-contracts",(0,n.createProviderClass)(i))},9027:(e,t,o)=>{o.d(t,{A:()=>D,w:()=>N});var n=o(1094),a=o(9422),r=o(6055),i=o(1030),s=o(8317),d=o.n(s);let l;function c(e){e.preventDefault(),e.stopPropagation(),function(e){const t=g(e);t.length>0&&window.parent.postMessage({sender:"previewer",type:"select-brick",iidList:t},l)}(e.composedPath())}function p(e){e.preventDefault(),e.stopPropagation()}const u=(0,i.throttle)((e=>{const t=g(e);t.length>0&&window.parent.postMessage({sender:"previewer",type:"hover-on-brick",iidList:t},l)}),100,{leading:!1});function v(e){e.preventDefault(),e.stopPropagation(),u(e.composedPath())}function h(e){e.preventDefault(),e.stopPropagation(),u(e.composedPath())}function w(e){e.preventDefault(),e.stopPropagation(),window.parent.postMessage({sender:"previewer",type:"hover-on-brick",iidList:[]},l)}function m(e){e.preventDefault(),e.stopPropagation(),function(e,t){const o=g(e);o.length>0&&window.parent.postMessage({sender:"previewer",type:"context-menu-on-brick",iidList:o,position:t},l)}(e.composedPath(),{x:e.clientX,y:e.clientY})}function g(e){const t=[];for(const o of e)o instanceof HTMLElement&&"string"==typeof o.dataset.iid&&t.push(o.dataset.iid);return t}var y=o(6788);function f(e){const t=typeof e;switch(t){case"string":case"boolean":case"number":return{type:t,value:e};case"undefined":return{type:t}}return null===e?{type:"null"}:Array.isArray(e)?{type:"array",length:e.length}:{type:"object"}}let b=!1,S=n.getHistory,I=n.matchPath,E=n.__secret_internals,L=r.flowApi,k=!1;try{var P;const e=window.dll;if(e&&null!==(P=window.BRICK_NEXT_VERSIONS)&&void 0!==P&&null!==(P=P["brick-container"])&&void 0!==P&&P.startsWith("2.")){const{getHistory:t,developHelper:o,collectDebugContract:n}=e("tYg3"),{matchPath:a}=e("A+yw");S=t,I=a,E={...o,getContextValue(e,t){let{tplStateStoreId:n}=t;return o.getContextValue(e,{tplContextId:n})},getAllContextValues(e){let{tplStateStoreId:t}=e;const n=o.getAllContextValues({tplContextId:t});return Object.fromEntries([...n].map((e=>{let[t,o]=e;return[t,o.value]})))},debugDataValue(e,t){let{tplStateStoreId:n}=t;return o.debugDataValue(e,{tplContextId:n})}},L={collectDebugContract:n},k=!0}}catch(e){console.error("Try to use v2 runtime APIs failed:",e)}let x=null,C=null;async function D(e,t){var o,r;if(b)return;b=!0;const s=t=>{window.parent.postMessage({sender:"previewer",...t},e)};let u,g,k,P;s({type:"preview-started"}),l=e;const D=(e,t,o)=>{const n=T(t);s({type:"highlight-brick",highlightType:e,outlines:n,iid:t,alias:o})};let N;t.templateId&&(N=t.settings);const R=()=>{E.updateTemplatePreviewSettings(t.appId,t.templateId,N),S().reload()},O=()=>{E.updateSnippetPreviewSettings(t.appId,JSON.parse(t.snippetData)),S().reload()},_=()=>{E.updateFormPreviewSettings(t.appId,t.formId,t.formData),S().reload()},q=S();window.addEventListener("message",(async o=>{var r,f;let{data:b,origin:I}=o;if(I===e&&b&&"preview-container"===b.sender)if("builder"===b.forwardedFor)switch(b.type){case"hover-on-brick":u=b.iid,g=b.alias,D("hover",b.iid,b.alias);break;case"hover-on-main":D("hover","#main-mount-point","root");break;case"hover-on-context":(e=>{const t=e.map((e=>T(e.iid,e.alias))).flat();s({type:"highlight-context",outlines:t})})(b.highlightNodes);break;case"select-brick":k=b.iid,P=b.alias,D("active",b.iid,b.alias);break;case"hover-on-iframe":(e=>{const t=document.elementFromPoint(e.x,e.y);if("BODY"===(null==t?void 0:t.tagName))window.parent.postMessage({sender:"previewer",type:"hover-on-main",isDirection:!0,position:{x:e.x,y:e.y}},l);else{const o=function(e){const t=[];let o=e;for(;o;)"string"==typeof o.dataset.iid&&t.push(o.dataset.iid),o=o.parentElement;return t}(t);window.parent.postMessage({sender:"previewer",type:"hover-on-brick",iidList:o,isDirection:!0,position:{x:e.x,y:e.y}},l)}})(b.position)}else switch(b.type){case"toggle-inspecting":b.enabled?(window.addEventListener("click",c,!0),window.addEventListener("mousedown",p,!0),window.addEventListener("mouseover",p,!0),window.addEventListener("mouseup",p,!0),window.addEventListener("pointerdown",v,!0),window.addEventListener("pointermove",h,!0),window.addEventListener("pointerup",p,!0),window.addEventListener("pointerleave",w,!0),window.addEventListener("contextmenu",m,!0)):(window.removeEventListener("click",c,!0),window.removeEventListener("mousedown",p,!0),window.removeEventListener("mouseover",p,!0),window.removeEventListener("mouseup",p,!0),window.removeEventListener("pointerdown",v,!0),window.removeEventListener("pointermove",h,!0),window.removeEventListener("pointerup",p,!0),window.removeEventListener("pointerleave",w,!0),window.removeEventListener("contextmenu",m,!0));break;case"refresh":if(null!==(r=b.options)&&void 0!==r&&r.updateStoryboardType){var x;let e;var C,M;"route"===b.options.updateStoryboardType?E.updateStoryboardByRoute(t.appId,b.storyboardPatch):"template"===b.options.updateStoryboardType?E.updateStoryboardByTemplate(t.appId,b.storyboardPatch,b.options.settings):"snippet"===b.options.updateStoryboardType?E.updateStoryboardBySnippet(t.appId,b.storyboardPatch):"form"===b.options.updateStoryboardType&&E.updateFormPreviewSettings(t.appId,t.formId,b.storyboardPatch),"form"!==(null===(x=b.options)||void 0===x?void 0:x.updateStoryboardType)&&(e=await(null===(C=(M=E).getAddedContracts)||void 0===C?void 0:C.call(M,b.storyboardPatch,{appId:t.appId,updateStoryboardType:b.options.updateStoryboardType,formId:t.formId,collectUsedContracts:y.b}))),(0,i.isEmpty)(e)?S().reload():s({type:"contract-update",data:{add:e}});break}E.updateStoryboard(t.appId,b.storyboardPatch),t.templateId?(N=b.settings,R()):t.formId||t.formData?_():null!==(f=b.options)&&void 0!==f&&f.snippetData?(t.snippetData=b.options.snippetData,O()):S().reload();break;case"reload":location.reload();break;case"back":q.goBack();break;case"forward":q.goForward();break;case"capture":(async function(e,t){const o=await d()(document.body,{logging:!1,scale:1,width:window.innerWidth,height:window.innerHeight,foreignObjectRendering:!0}),n=document.createElement("canvas");var a;return function(e,t,o,n){const a=o/n,{width:r,height:i}=e,s=r/i,d=s>=a,l=d?o:n*s,c=d?o/s:n;t.width=l,t.height=c,t.getContext("2d").drawImage(e,0,0,r,i,0,0,l,c),t.toDataURL()}(o,n,e,t),await(a=n,new Promise((function(e,t){a.toBlob((function(o){o?e(o):t()}))})))})(b.maxWidth,b.maxHeight).then((e=>{s({type:"capture-ok",screenshot:e})}),(()=>{s({type:"capture-failed"})}));break;case"inspect-data-value":((e,t)=>{try{const{dataType:o}=t;let n,a,r;if("state"===o&&(n=A(),!n))return void s({type:"inspect-data-value-error",data:{error:{message:"tplStateStoreId not found, unable to preview STATE value"}}});if(e)r="inspect-single-data-value-success",a=E.getContextValue(e,{tplStateStoreId:n});else{r="inspect-all-data-values-success";const e=E.getAllContextValues({tplStateStoreId:n});a=Object.entries(e).map((e=>{let[t,o]=e;return{name:t,value:o}}))}s({type:r,data:{name:e,value:a}})}catch(e){s({type:"inspect-data-value-error",data:{message:e.message}})}})(b.name,b.option);break;case"update-preview-url":{const e=b.previewUrl.startsWith(window.origin)?b.previewUrl.substring(window.origin.length):b.previewUrl,t=(0,n.getBasePath)(),o=e.startsWith(t)?e.substring(t.length-1):e;S().push(o);break}case"update-preview-route":t.routePath=b.routePath,t.routeExact=b.routeExact,B();break;case"debug-data-value":(async(e,o,n)=>{try{o&&L.collectDebugContract([o]);const a=await E.debugDataValue(e,{tplStateStoreId:"state"===n.dataType?A():void 0,routeId:t.routeId});s({type:"debug-data-value-success",data:{debugConf:e,value:a}})}catch(e){s({type:"debug-data-value-error",data:e instanceof a.HttpResponseError?e.responseJson:{message:e.message}})}})(b.debugData,b.contractData,b.options)}})),window.addEventListener("scroll",(()=>{s({type:"scroll",scroll:{x:window.scrollX,y:window.scrollY}})}));let M,H=!0;const V=e=>{s({type:"url-change",url:location.origin+q.createHref(e)}),M=e,B()};function B(){if(t.routePath){const e=!!I(M.pathname,{path:t.routePath,exact:t.routeExact});if(s({type:"route-match-change",match:e}),t.templateId&&!H&&e){const e=document.querySelector("#main-mount-point"),t=new MutationObserver((()=>{1===e.childNodes.length&&"SPAN"===e.firstChild.tagName&&0===e.firstChild.childNodes.length&&(R(),t.disconnect())}));t.observe(e,{childList:!0})}if(t.formId&&!H&&e){const e=document.querySelector("#main-mount-point"),t=new MutationObserver((()=>{1===e.childNodes.length&&"SPAN"===e.firstChild.tagName&&0===e.firstChild.childNodes.length&&(_(),t.disconnect())}));t.observe(e,{childList:!0})}if(t.snippetData&&!H&&e){const e=document.querySelector("#main-mount-point"),t=new MutationObserver((()=>{1===e.childNodes.length&&"SPAN"===e.firstChild.tagName&&0===e.firstChild.childNodes.length&&(O(),t.disconnect())}));t.observe(e,{childList:!0})}H=e}}function j(){var e;const t=document.querySelector("eo-page-view"),o=(null==t||null===(e=t.shadowRoot)||void 0===e?void 0:e.querySelector(".content"))??null;var n;o!==x&&(null===(n=x)||void 0===n||n.removeEventListener("scroll",F),null==o||o.addEventListener("scroll",F),x=o,C=t)}function F(){s({type:"content-scroll",scroll:{x:this.scrollLeft,y:this.scrollTop}})}V(q.location),q.listen(V),t.templateId&&R(),(t.formId||t.formData)&&_(),t.snippetData&&O();const U=()=>{var e;const o=t.routeId,n=E.getLegalRuntimeValue({routeId:o});s({type:"inspect-runtime-data-value",data:{...(0,i.omit)(n,"query"),query:n.query?Object.fromEntries(n.query.entries()):{},path:null===(e=n.match)||void 0===e?void 0:e.params}})};let W;function Y(e){const o=t.templateId?A():void 0;var n,a;(W!==o||e)&&(W=o,null===(n=(a=E).setRealTimeDataInspectRoot)||void 0===n||n.call(a,{tplStateStoreId:o}))}null===(o=(r=E).addRealTimeDataInspectHook)||void 0===o||o.call(r,(e=>{let{changeType:t,tplStateStoreId:o,detail:n}=e;s({type:"real-time-data-inspect-change",changeType:t,tplStateStoreId:o,detail:"update"===t?{name:n.name,annotation:f(n.value)}:{data:Object.fromEntries(Object.entries(n.data).map((e=>{let[t,o]=e;return[t,f(o)]})))}})})),window.addEventListener("route.render",(()=>{Y(!0),U()})),j(),Y(!0),U(),new MutationObserver((0,i.throttle)((()=>{j(),Y(),u&&D("hover",u,g),k&&D("active",k,P)}),100,{leading:!1})).observe(document.body,{subtree:!0,childList:!0})}function T(e,t){if(!e)return[];const o=e.includes("#"),n=function(e,t){return e.map((e=>{var o;const n=null===(o=C)||void 0===o?void 0:o.contains(e),{width:a,height:r,left:i,top:s}=e.getBoundingClientRect();return{width:a,height:r,left:i+window.scrollX+(n?x.scrollLeft:0),top:s+window.scrollY+(n?x.scrollTop:0),alias:t,hasContentScroll:n}}))}(N(e,o),t);return o?n.map((e=>({...e,height:window.innerHeight-e.top}))):n}function N(e,t){const o=[];return function n(a){const r=a.querySelectorAll(t?e:`[data-iid="${e}"]`);if(o.push(...r),!(a===document&&r.length>0))for(const e of a.querySelectorAll("*"))e.shadowRoot&&n(e.shadowRoot)}(document),o}function A(){var e;const t=document.querySelector("#main-mount-point");return null==t||null===(e=t.firstChild)||void 0===e?void 0:e.dataset[k?"tplContextId":"tplStateStoreId"]}}}]);
|
|
2
|
+
//# sourceMappingURL=9027.5ba5abc4.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunks/9027.e3490283.js","mappings":"yMAgCO,SAASA,EAAqBC,GACnC,MAAMC,EArBR,SAAiBC,GACf,MAAMD,EAAa,IAAIE,IAgBvB,OAdAC,EAAAA,EAAAA,GAASF,GAAcG,IACrB,OAAQA,EAAKC,MACX,IAAK,aACL,IAAK,eAAgB,KAAAC,EACnB,MAAMC,EACI,QADOD,EACfF,EAAKI,WAAG,IAAAF,OAAA,EADUA,EAEjBC,YACCA,GACFP,EAAWS,IAAIF,EAEnB,EACF,IAGKP,CACT,CAGqBU,EAAQC,EAAAA,EAAAA,IAAgBZ,IAErCa,EAAY,GAElB,IAAK,MAAMC,KAAQb,EACba,EAAKC,SAAS,MAChBF,EAAUG,KAAKF,GAInB,OAAOD,CACT,CAEAI,eAAeC,OACb,yCACAC,EAAAA,EAAAA,qBAAoBpB,G,yGCvCf,IAAIqB,EAsCX,SAASC,EAAQC,GACfA,EAAMC,iBACND,EAAME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QD,SAA0B,QAAZqD,EAAdrD,EAAgBK,kBAAU,IAAAgD,OAAA,EAA3BA,EAA6C7O,QAClDe,EAAO,eAAiB,kBAE5B,C","sources":["webpack:///./src/data-providers/collect-used-contracts.ts","webpack:///./src/data-providers/preview/inspector.ts","webpack:///./src/data-providers/preview/realTimeDataInspect.ts","webpack:///./src/data-providers/preview/connect.ts","webpack:///./src/data-providers/preview/capture.ts","webpack:///./src/data-providers/preview/resizeScreenshot.ts"],"sourcesContent":["import { createProviderClass } from \"@next-core/utils/general\";\nimport {\n type StoryboardNode,\n parseStoryboard,\n traverse,\n} from \"@next-core/storyboard\";\nimport {\n Storyboard,\n UseProviderResolveConf,\n UseProviderEventHandler,\n} from \"@next-core/types\";\n\nfunction collect(nodeOrNodes: StoryboardNode | StoryboardNode[]): Set<string> {\n const collection = new Set<string>();\n\n traverse(nodeOrNodes, (node) => {\n switch (node.type) {\n case \"Resolvable\":\n case \"EventHandler\": {\n const useProvider = (\n node.raw as UseProviderResolveConf | UseProviderEventHandler\n )?.useProvider;\n if (useProvider) {\n collection.add(useProvider);\n }\n }\n }\n });\n\n return collection;\n}\n\nexport function collectUsedContracts(storyboard: Storyboard): string[] {\n const collection = collect(parseStoryboard(storyboard as any));\n\n const contracts = [];\n\n for (const item of collection) {\n if (item.includes(\"@\")) {\n contracts.push(item);\n }\n }\n\n return contracts;\n}\n\ncustomElements.define(\n \"visual-builder.collect-used-contracts\",\n createProviderClass(collectUsedContracts)\n);\n","// istanbul ignore file: working in progress\n// https://github.com/facebook/react/blob/cae635054e17a6f107a39d328649137b83f25972/packages/react-devtools-shared/src/backend/views/Highlighter/index.js\nimport { throttle } from \"lodash\";\nimport type {\n PreviewMessagePreviewerHoverOnBrick,\n PreviewMessagePreviewerSelectBrick,\n PreviewMessagePreviewerContextMenuOnBrick,\n} from \"./interfaces.js\";\n\nexport let previewProxyOrigin: string;\n\nexport function setPreviewFromOrigin(origin: string): void {\n previewProxyOrigin = origin;\n}\n\nexport function startInspecting(): void {\n registerListeners();\n}\n\nexport function stopInspecting(): void {\n unregisterListeners();\n}\n\nfunction registerListeners(): void {\n window.addEventListener(\"click\", onClick, true);\n window.addEventListener(\"mousedown\", onMouseEvent, true);\n window.addEventListener(\"mouseover\", onMouseEvent, true);\n window.addEventListener(\"mouseup\", onMouseEvent, true);\n window.addEventListener(\"pointerdown\", onPointerDown, true);\n window.addEventListener(\"pointermove\", onPointerMove, true);\n window.addEventListener(\"pointerup\", onMouseEvent, true);\n window.addEventListener(\"pointerleave\", onPointerLeave, true);\n window.addEventListener(\"contextmenu\", onContextMenu, true);\n}\n\nfunction unregisterListeners(): void {\n window.removeEventListener(\"click\", onClick, true);\n window.removeEventListener(\"mousedown\", onMouseEvent, true);\n window.removeEventListener(\"mouseover\", onMouseEvent, true);\n window.removeEventListener(\"mouseup\", onMouseEvent, true);\n window.removeEventListener(\"pointerdown\", onPointerDown, true);\n window.removeEventListener(\"pointermove\", onPointerMove, true);\n window.removeEventListener(\"pointerup\", onMouseEvent, true);\n window.removeEventListener(\"pointerleave\", onPointerLeave, true);\n window.removeEventListener(\"contextmenu\", onContextMenu, true);\n}\n\nfunction onClick(event: MouseEvent): void {\n event.preventDefault();\n event.stopPropagation();\n selectBrick(event.composedPath());\n}\n\nfunction onMouseEvent(event: MouseEvent): void {\n event.preventDefault();\n event.stopPropagation();\n}\n\nconst hoverOnBrick = throttle(\n (eventTargets: EventTarget[]) => {\n const iidList = getPossibleBrickTargets(eventTargets);\n\n if (iidList.length > 0) {\n window.parent.postMessage(\n {\n sender: \"previewer\",\n type: \"hover-on-brick\",\n iidList,\n } as PreviewMessagePreviewerHoverOnBrick,\n previewProxyOrigin\n );\n }\n },\n 100,\n { leading: false }\n);\n\nfunction onPointerDown(event: MouseEvent): void {\n event.preventDefault();\n event.stopPropagation();\n hoverOnBrick(event.composedPath());\n}\n\nfunction onPointerMove(event: MouseEvent): void {\n event.preventDefault();\n event.stopPropagation();\n hoverOnBrick(event.composedPath());\n}\n\nfunction onPointerLeave(event: MouseEvent): void {\n event.preventDefault();\n event.stopPropagation();\n window.parent.postMessage(\n {\n sender: \"previewer\",\n type: \"hover-on-brick\",\n iidList: [],\n } as PreviewMessagePreviewerHoverOnBrick,\n previewProxyOrigin\n );\n}\n\nfunction onContextMenu(event: MouseEvent): void {\n event.preventDefault();\n event.stopPropagation();\n contextMenuOnBrick(event.composedPath(), {\n x: event.clientX,\n y: event.clientY,\n });\n}\n\nfunction contextMenuOnBrick(\n eventTargets: EventTarget[],\n position: {\n x: number;\n y: number;\n }\n): void {\n const iidList = getPossibleBrickTargets(eventTargets);\n if (iidList.length > 0) {\n window.parent.postMessage(\n {\n sender: \"previewer\",\n type: \"context-menu-on-brick\",\n iidList,\n position,\n } as PreviewMessagePreviewerContextMenuOnBrick,\n previewProxyOrigin\n );\n }\n}\n\nfunction selectBrick(eventTargets: EventTarget[]): void {\n const iidList = getPossibleBrickTargets(eventTargets);\n if (iidList.length > 0) {\n window.parent.postMessage(\n {\n sender: \"previewer\",\n type: \"select-brick\",\n iidList,\n } as PreviewMessagePreviewerSelectBrick,\n previewProxyOrigin\n );\n }\n}\n\nexport function getPossibleBrickIidList(brick: HTMLElement): string[] {\n const iidList: string[] = [];\n // Traverse from bottom to up, to find bricks current hover on.\n let cursor: HTMLElement | null = brick;\n while (cursor) {\n if (typeof cursor.dataset.iid === \"string\") {\n iidList.push(cursor.dataset.iid);\n }\n cursor = cursor.parentElement;\n }\n return iidList;\n}\n\nexport function getPossibleBrickTargets(eventTargets: EventTarget[]) {\n const targets: string[] = [];\n for (const target of eventTargets) {\n if (\n target instanceof HTMLElement &&\n typeof target.dataset.iid === \"string\"\n ) {\n targets.push(target.dataset.iid);\n }\n }\n return targets;\n}\n","export function getRealTimeDataAnnotation(value: unknown) {\n const type = typeof value;\n switch (type) {\n case \"string\":\n case \"boolean\":\n case \"number\":\n return {\n type,\n value,\n };\n case \"undefined\":\n return { type };\n }\n if (value === null) {\n return { type: \"null\" };\n }\n if (Array.isArray(value)) {\n return { type: \"array\", length: value.length };\n }\n return { type: \"object\" };\n}\n","import {\n getHistory as _getHistory,\n getBasePath,\n matchPath as _matchPath,\n __secret_internals as _internals,\n type NextLocation,\n} from \"@next-core/runtime\";\nimport { HttpResponseError } from \"@next-core/http\";\nimport { flowApi as _flowAPi } from \"@next-core/easyops-runtime\";\nimport type {\n BrickConf,\n Contract,\n CustomTemplate,\n RouteConf,\n} from \"@next-core/types\";\nimport { isEmpty, throttle, omit } from \"lodash\";\nimport type {\n BrickOutline,\n HighLightNode,\n Position,\n PreviewDataOption,\n PreviewMessageFromPreviewer,\n PreviewMessagePreviewContractUpdate,\n PreviewMessagePreviewDataValueError,\n PreviewMessagePreviewDataValueSuccess,\n PreviewMessagePreviewDebugValueSuccess,\n PreviewMessagePreviewDebugValueError,\n PreviewMessagePreviewerCaptureFailed,\n PreviewMessagePreviewerCaptureOk,\n PreviewMessagePreviewerContentScroll,\n PreviewMessagePreviewerHighlightBrick,\n PreviewMessagePreviewerHighlightContext,\n PreviewMessagePreviewerHoverOnMain,\n PreviewMessagePreviewerRealTimeDataInspectChange,\n PreviewMessagePreviewerRouteMatchChange,\n PreviewMessagePreviewerScroll,\n PreviewMessagePreviewerUrlChange,\n PreviewMessageToPreviewer,\n PreviewSettings,\n PreviewStartOptions,\n PreviewDebugData,\n PreviewMessagePreviewInspectRuntimeValue,\n} from \"./interfaces.js\";\nimport { capture } from \"./capture.js\";\nimport {\n previewProxyOrigin,\n getPossibleBrickIidList,\n setPreviewFromOrigin,\n startInspecting,\n stopInspecting,\n} from \"./inspector.js\";\nimport { collectUsedContracts } from \"../collect-used-contracts.js\";\nimport { getRealTimeDataAnnotation } from \"./realTimeDataInspect.js\";\n\nlet connected = false;\n\ninterface DLL {\n (moduleId: \"tYg3\"): {\n getHistory: typeof _getHistory;\n developHelper: typeof _internals;\n collectDebugContract: typeof flowApi.collectDebugContract;\n };\n (moduleId: \"A+yw\"): {\n matchPath: typeof _matchPath;\n };\n}\n\nlet getHistory = _getHistory;\nlet matchPath = _matchPath;\nlet __secret_internals = _internals;\nlet flowApi = _flowAPi;\nlet isV2 = false;\n\n// istanbul ignore next\n// Make v3 bricks compatible with Brick Next v2.\ntry {\n const dll = (window as unknown as { dll?: DLL }).dll;\n if (\n dll &&\n window.BRICK_NEXT_VERSIONS?.[\"brick-container\"]?.startsWith(\"2.\")\n ) {\n const {\n getHistory: getHistoryV2,\n developHelper: developHelperV2,\n collectDebugContract,\n } = dll(\"tYg3\");\n const { matchPath: matchPathV2 } = dll(\"A+yw\");\n getHistory = getHistoryV2;\n matchPath = matchPathV2;\n // The `__secret_internals` of v3 has pretty the same API as\n // `developHelper` of v2, especially those for preview usage.\n __secret_internals = {\n ...developHelperV2,\n getContextValue(name, { tplStateStoreId }) {\n return developHelperV2.getContextValue(name, {\n tplContextId: tplStateStoreId,\n } as any);\n },\n getAllContextValues({ tplStateStoreId }) {\n // V3 returns an object of key-value.\n // While v2 returns a map of ContextItem.\n const v2Map = developHelperV2.getAllContextValues({\n tplContextId: tplStateStoreId,\n } as any) as unknown as Map<string, { value: unknown }>;\n return Object.fromEntries(\n [...v2Map].map(([k, v]) => [k, (v as any).value])\n );\n },\n debugDataValue(data, { tplStateStoreId }) {\n return developHelperV2.debugDataValue(data, {\n tplContextId: tplStateStoreId,\n } as any);\n },\n };\n\n flowApi = {\n collectDebugContract,\n } as any;\n isV2 = true;\n }\n} catch (e) {\n // eslint-disable-next-line no-console\n console.error(\"Try to use v2 runtime APIs failed:\", e);\n}\n\nlet contentScrollElement: Element | null = null;\nlet contentScrollHost: Element | null = null;\n\nexport default async function connect(\n previewFromOrigin: string,\n options: PreviewStartOptions\n) {\n if (connected) {\n return;\n }\n connected = true;\n\n const sendMessage = <T extends PreviewMessageFromPreviewer>(\n message: Omit<T, \"sender\">\n ): void => {\n window.parent.postMessage(\n {\n sender: \"previewer\",\n ...message,\n },\n previewFromOrigin\n );\n };\n\n sendMessage({ type: \"preview-started\" });\n setPreviewFromOrigin(previewFromOrigin);\n\n let hoverIid: string;\n let hoverAlias: string;\n let activeIid: string;\n let activeAlias: string;\n\n const handleHoverOnIframe = (pos: Position): void => {\n const element = document.elementFromPoint(pos.x, pos.y);\n if (element?.tagName === \"BODY\") {\n window.parent.postMessage(\n {\n sender: \"previewer\",\n type: \"hover-on-main\",\n isDirection: true,\n position: {\n x: pos.x,\n y: pos.y,\n },\n } as PreviewMessagePreviewerHoverOnMain,\n previewProxyOrigin\n );\n } else {\n const iidList = getPossibleBrickIidList(element as HTMLElement);\n window.parent.postMessage(\n {\n sender: \"previewer\",\n type: \"hover-on-brick\",\n iidList,\n isDirection: true,\n position: {\n x: pos.x,\n y: pos.y,\n },\n },\n previewProxyOrigin\n );\n }\n };\n\n const sendHighlightBrickOutlines = (\n type: \"hover\" | \"active\",\n iid: string,\n alias: string\n ): void => {\n const outlines = getBrickOutlines(iid);\n sendMessage<PreviewMessagePreviewerHighlightBrick>({\n type: \"highlight-brick\",\n highlightType: type,\n outlines,\n iid: iid,\n alias: alias,\n });\n };\n\n const sendHighlightBricksOutlines = (nodes: HighLightNode[]): void => {\n const outlines = nodes\n .map((node) => getBrickOutlines(node.iid, node.alias))\n .flat();\n sendMessage<PreviewMessagePreviewerHighlightContext>({\n type: \"highlight-context\",\n outlines,\n });\n };\n\n let lastTemplatePreviewSettings: PreviewSettings | undefined;\n if (options.templateId) {\n lastTemplatePreviewSettings = options.settings;\n }\n\n const updateTemplatePreviewSettings = (): void => {\n __secret_internals.updateTemplatePreviewSettings(\n options.appId,\n options.templateId!,\n lastTemplatePreviewSettings\n );\n getHistory().reload();\n };\n\n const updateSnippetPreviewSettings = (): void => {\n __secret_internals.updateSnippetPreviewSettings(\n options.appId,\n JSON.parse(options.snippetData)\n );\n getHistory().reload();\n };\n\n const updateFormPreviewSettings = (): void => {\n (__secret_internals as any).updateFormPreviewSettings(\n options.appId,\n options.formId,\n options.formData\n );\n getHistory().reload();\n };\n\n const handlePreviewData = (name: string, option: PreviewDataOption): void => {\n try {\n const { dataType } = option;\n let tplStateStoreId;\n\n if (dataType === \"state\") {\n tplStateStoreId = getRootTplStateStoreId();\n\n if (!tplStateStoreId) {\n sendMessage<PreviewMessagePreviewDataValueError>({\n type: \"inspect-data-value-error\",\n data: {\n error: {\n message:\n \"tplStateStoreId not found, unable to preview STATE value\",\n },\n },\n });\n\n return;\n }\n }\n\n let value, type: PreviewMessagePreviewDataValueSuccess[\"type\"];\n if (name) {\n type = \"inspect-single-data-value-success\";\n value = __secret_internals.getContextValue(name, {\n tplStateStoreId,\n });\n } else {\n type = \"inspect-all-data-values-success\";\n const data = __secret_internals.getAllContextValues({\n tplStateStoreId,\n });\n value = Object.entries(data).map(([name, value]) => ({ name, value }));\n }\n\n sendMessage<PreviewMessagePreviewDataValueSuccess>({\n type,\n data: {\n name,\n value,\n },\n });\n\n // istanbul ignore next\n } catch (error) {\n sendMessage<PreviewMessagePreviewDataValueError>({\n type: \"inspect-data-value-error\",\n data: {\n message: (error as Error).message,\n },\n });\n }\n };\n\n const debugDataValue = async (\n data: PreviewDebugData,\n contractData: Contract,\n previewOption: PreviewDataOption\n ) => {\n try {\n if (contractData) {\n flowApi.collectDebugContract([contractData]);\n }\n const value = await __secret_internals.debugDataValue(data, {\n tplStateStoreId:\n previewOption.dataType === \"state\"\n ? getRootTplStateStoreId()\n : undefined,\n routeId: options.routeId,\n });\n\n sendMessage<PreviewMessagePreviewDebugValueSuccess>({\n type: \"debug-data-value-success\",\n data: {\n debugConf: data,\n value,\n },\n });\n } catch (error) {\n sendMessage<PreviewMessagePreviewDebugValueError>({\n type: \"debug-data-value-error\",\n data:\n error instanceof HttpResponseError\n ? error.responseJson\n : { message: (error as Error).message },\n });\n }\n };\n\n const history = getHistory();\n\n window.addEventListener(\n \"message\",\n async ({ data, origin }: MessageEvent<PreviewMessageToPreviewer>) => {\n if (\n origin !== previewFromOrigin ||\n !data ||\n data.sender !== \"preview-container\"\n ) {\n return;\n }\n if (data.forwardedFor === \"builder\") {\n switch (data.type) {\n case \"hover-on-brick\":\n hoverIid = data.iid;\n hoverAlias = data.alias;\n sendHighlightBrickOutlines(\"hover\", data.iid, data.alias);\n break;\n case \"hover-on-main\":\n sendHighlightBrickOutlines(\"hover\", \"#main-mount-point\", \"root\");\n break;\n case \"hover-on-context\":\n sendHighlightBricksOutlines(data.highlightNodes);\n break;\n case \"select-brick\":\n activeIid = data.iid;\n activeAlias = data.alias;\n sendHighlightBrickOutlines(\"active\", data.iid, data.alias);\n break;\n case \"hover-on-iframe\":\n handleHoverOnIframe(data.position);\n break;\n }\n } else\n switch (data.type) {\n case \"toggle-inspecting\":\n data.enabled ? startInspecting() : stopInspecting();\n break;\n case \"refresh\":\n if (data.options?.updateStoryboardType) {\n if (data.options.updateStoryboardType === \"route\") {\n __secret_internals.updateStoryboardByRoute(\n options.appId,\n data.storyboardPatch as RouteConf\n );\n } else if (data.options.updateStoryboardType === \"template\") {\n __secret_internals.updateStoryboardByTemplate(\n options.appId,\n data.storyboardPatch as CustomTemplate,\n data.options.settings\n );\n } else if (data.options.updateStoryboardType === \"snippet\") {\n __secret_internals.updateStoryboardBySnippet(\n options.appId,\n data.storyboardPatch as {\n snippetId: string;\n bricks: BrickConf[];\n }\n );\n } else if (data.options.updateStoryboardType === \"form\") {\n (__secret_internals as any).updateFormPreviewSettings(\n options.appId,\n options.formId,\n data.storyboardPatch\n );\n }\n\n let newContracts;\n if (data.options?.updateStoryboardType !== \"form\") {\n newContracts = await (\n __secret_internals as any\n ).getAddedContracts?.(data.storyboardPatch, {\n appId: options.appId,\n updateStoryboardType: data.options.updateStoryboardType,\n formId: options.formId,\n collectUsedContracts,\n });\n }\n\n if (!isEmpty(newContracts)) {\n sendMessage<PreviewMessagePreviewContractUpdate>({\n type: \"contract-update\",\n data: {\n add: newContracts,\n },\n });\n } else {\n getHistory().reload();\n }\n\n break;\n }\n __secret_internals.updateStoryboard(\n options.appId,\n data.storyboardPatch\n );\n if (options.templateId) {\n lastTemplatePreviewSettings = data.settings;\n updateTemplatePreviewSettings();\n } else if (options.formId || options.formData) {\n updateFormPreviewSettings();\n } else if (data.options?.snippetData) {\n options.snippetData = data.options.snippetData;\n updateSnippetPreviewSettings();\n } else {\n getHistory().reload();\n }\n break;\n case \"reload\":\n location.reload();\n break;\n case \"back\":\n history.goBack();\n break;\n case \"forward\":\n history.goForward();\n break;\n case \"capture\":\n capture(data.maxWidth, data.maxHeight).then(\n (screenshot) => {\n sendMessage<PreviewMessagePreviewerCaptureOk>({\n type: \"capture-ok\",\n screenshot,\n });\n },\n () => {\n sendMessage<PreviewMessagePreviewerCaptureFailed>({\n type: \"capture-failed\",\n });\n }\n );\n break;\n case \"inspect-data-value\":\n handlePreviewData(data.name, data.option);\n break;\n case \"update-preview-url\": {\n // Remove origin first.\n const url = data.previewUrl.startsWith(window.origin)\n ? data.previewUrl.substring(window.origin.length)\n : data.previewUrl;\n // Then remove base path.\n const basePath = getBasePath();\n const to = url.startsWith(basePath)\n ? url.substring(basePath.length - 1)\n : url;\n getHistory().push(to);\n break;\n }\n case \"update-preview-route\": {\n options.routePath = data.routePath;\n options.routeExact = data.routeExact;\n syncRouteMatch();\n break;\n }\n case \"debug-data-value\":\n debugDataValue(data.debugData, data.contractData, data.options);\n break;\n /* case \"excute-proxy-method\": {\n const [ref, method, args = []] = data.proxyMethodArgs;\n try {\n const result = document.body.querySelector(ref)[method](...args);\n window.parent.postMessage({\n sender: \"previewer\",\n type: \"excute-proxy-method-success\",\n data: { method: method, res: result },\n });\n } catch (err) {\n window.parent.postMessage({\n sender: \"previewer\",\n type: \"excute-proxy-method-error\",\n data: { method: method, res: err.message },\n });\n }\n break;\n } */\n }\n }\n );\n\n window.addEventListener(\"scroll\", () => {\n sendMessage<PreviewMessagePreviewerScroll>({\n type: \"scroll\",\n scroll: {\n x: window.scrollX,\n y: window.scrollY,\n },\n });\n });\n\n let previewPageMatch = true;\n let currentLocation: NextLocation;\n const sendLocationChange = (loc: NextLocation): void => {\n sendMessage<PreviewMessagePreviewerUrlChange>({\n type: \"url-change\",\n url: location.origin + history.createHref(loc),\n });\n currentLocation = loc;\n syncRouteMatch();\n };\n\n function syncRouteMatch() {\n if (options.routePath) {\n const match = !!matchPath(currentLocation.pathname, {\n path: options.routePath,\n exact: options.routeExact,\n });\n sendMessage<PreviewMessagePreviewerRouteMatchChange>({\n type: \"route-match-change\",\n match,\n });\n\n // Re-update template preview settings once match route again (typically after login).\n if (options.templateId && !previewPageMatch && match) {\n const mainMountPoint = document.querySelector(\"#main-mount-point\")!;\n const placeholderLoadObserver = new MutationObserver(() => {\n // We observe when the placeholder is appeared.\n if (\n mainMountPoint.childNodes.length === 1 &&\n (mainMountPoint.firstChild as HTMLElement).tagName === \"SPAN\" &&\n mainMountPoint.firstChild!.childNodes.length === 0\n ) {\n updateTemplatePreviewSettings();\n placeholderLoadObserver.disconnect();\n }\n });\n placeholderLoadObserver.observe(mainMountPoint, { childList: true });\n }\n if (options.formId && !previewPageMatch && match) {\n const mainMountPoint = document.querySelector(\"#main-mount-point\");\n const placeholderLoadObserver = new MutationObserver(() => {\n // We observe when the placeholder is appeared.\n if (\n mainMountPoint.childNodes.length === 1 &&\n (mainMountPoint.firstChild as HTMLElement).tagName === \"SPAN\" &&\n mainMountPoint.firstChild.childNodes.length === 0\n ) {\n updateFormPreviewSettings();\n placeholderLoadObserver.disconnect();\n }\n });\n placeholderLoadObserver.observe(mainMountPoint, { childList: true });\n }\n if (options.snippetData && !previewPageMatch && match) {\n const mainMountPoint = document.querySelector(\"#main-mount-point\")!;\n const placeholderLoadObserver = new MutationObserver(() => {\n // We observe when the placeholder is appeared.\n if (\n mainMountPoint.childNodes.length === 1 &&\n (mainMountPoint.firstChild as HTMLElement).tagName === \"SPAN\" &&\n mainMountPoint.firstChild!.childNodes.length === 0\n ) {\n updateSnippetPreviewSettings();\n placeholderLoadObserver.disconnect();\n }\n });\n placeholderLoadObserver.observe(mainMountPoint, { childList: true });\n }\n previewPageMatch = match;\n }\n }\n\n sendLocationChange(history.location);\n\n history.listen(sendLocationChange);\n\n if (options.templateId) {\n updateTemplatePreviewSettings();\n }\n\n if (options.formId || options.formData) {\n updateFormPreviewSettings();\n }\n\n if (options.snippetData) {\n updateSnippetPreviewSettings();\n }\n\n function setupContentScroll() {\n const host = document.querySelector(\"eo-page-view\");\n const element = host?.shadowRoot?.querySelector(\".content\") ?? null;\n if (element !== contentScrollElement) {\n contentScrollElement?.removeEventListener(\"scroll\", onContentScroll);\n element?.addEventListener(\"scroll\", onContentScroll);\n contentScrollElement = element;\n contentScrollHost = host;\n }\n }\n\n function onContentScroll(this: Element) {\n sendMessage<PreviewMessagePreviewerContentScroll>({\n type: \"content-scroll\",\n scroll: {\n x: this.scrollLeft,\n y: this.scrollTop,\n },\n });\n }\n\n const setupRuntimeValueInspect = () => {\n const routeId = options.routeId;\n\n const data = __secret_internals.getLegalRuntimeValue({ routeId });\n sendMessage<PreviewMessagePreviewInspectRuntimeValue>({\n type: \"inspect-runtime-data-value\",\n data: {\n ...omit(data, \"query\"),\n query: data.query ? Object.fromEntries(data.query.entries()) : {},\n path: data.match?.params,\n },\n });\n };\n\n __secret_internals.addRealTimeDataInspectHook?.(\n ({ changeType, tplStateStoreId, detail }) => {\n sendMessage<PreviewMessagePreviewerRealTimeDataInspectChange>({\n type: \"real-time-data-inspect-change\",\n changeType,\n tplStateStoreId,\n detail:\n changeType === \"update\"\n ? {\n name: detail.name,\n annotation: getRealTimeDataAnnotation(detail.value),\n }\n : {\n data: Object.fromEntries(\n Object.entries(detail.data).map(([k, v]) => [\n k,\n getRealTimeDataAnnotation(v),\n ])\n ),\n },\n });\n }\n );\n\n let memoizedRootTplStateStoreId: string | undefined;\n\n function setupRealTimeDataInspect(force?: boolean) {\n const tplStateStoreId = options.templateId\n ? getRootTplStateStoreId()\n : undefined;\n if (memoizedRootTplStateStoreId !== tplStateStoreId || force) {\n memoizedRootTplStateStoreId = tplStateStoreId;\n __secret_internals.setRealTimeDataInspectRoot?.({\n tplStateStoreId,\n });\n }\n }\n\n window.addEventListener(\"route.render\", () => {\n setupRealTimeDataInspect(true);\n setupRuntimeValueInspect();\n });\n\n setupContentScroll();\n setupRealTimeDataInspect(true);\n setupRuntimeValueInspect();\n\n const mutationCallback = (): void => {\n setupContentScroll();\n setupRealTimeDataInspect();\n if (hoverIid) {\n sendHighlightBrickOutlines(\"hover\", hoverIid, hoverAlias);\n }\n if (activeIid) {\n sendHighlightBrickOutlines(\"active\", activeIid, activeAlias);\n }\n };\n const mutationObserver = new MutationObserver(\n throttle(mutationCallback, 100, { leading: false })\n );\n mutationObserver.observe(document.body, { subtree: true, childList: true });\n}\n\nfunction getBrickOutlines(iid: string, alias?: string): BrickOutline[] {\n if (!iid) {\n return [];\n }\n const isRoot = iid.includes(\"#\");\n const elements = getElementsIncludingInShadowDOM(iid, isRoot);\n const outlines = getOutlines(elements, alias);\n return isRoot\n ? outlines.map((item) => ({\n ...item,\n height: window.innerHeight - item.top,\n }))\n : outlines;\n}\n\nexport function getElementsIncludingInShadowDOM(\n iid: string,\n isRoot?: boolean\n): HTMLElement[] {\n const elements: HTMLElement[] = [];\n\n function walk(root: Document | ShadowRoot) {\n const candidates = root.querySelectorAll<HTMLElement>(\n isRoot ? iid : `[data-iid=\"${iid}\"]`\n );\n elements.push(...candidates);\n\n // If elements are found in the document, we should stop searching in shadow DOM.\n if (root === document && candidates.length > 0) {\n return;\n }\n\n // These useBrick in v3 bricks will be inside shadow DOM.\n for (const item of root.querySelectorAll(\"*\")) {\n if (item.shadowRoot) {\n walk(item.shadowRoot);\n }\n }\n }\n\n walk(document);\n\n return elements;\n}\n\nfunction getOutlines(elements: HTMLElement[], alias?: string): BrickOutline[] {\n return elements.map((element) => {\n const hasContentScroll = contentScrollHost?.contains(element);\n const { width, height, left, top } = element.getBoundingClientRect();\n return {\n width,\n height,\n left:\n left +\n window.scrollX +\n (hasContentScroll ? contentScrollElement.scrollLeft : 0),\n top:\n top +\n window.scrollY +\n (hasContentScroll ? contentScrollElement.scrollTop : 0),\n alias,\n hasContentScroll,\n };\n });\n}\n\nfunction getRootTplStateStoreId(): string | undefined {\n const mainMountPoint = document.querySelector(\"#main-mount-point\")!;\n\n return (mainMountPoint?.firstChild as HTMLElement)?.dataset[\n isV2 ? \"tplContextId\" : \"tplStateStoreId\"\n ];\n}\n","// istanbul ignore file: nothing logical except calling html2canvas.\nimport html2canvas from \"html2canvas\";\nimport { resizeScreenshot } from \"./resizeScreenshot.js\";\n\nfunction getCanvasBlob(canvas: HTMLCanvasElement): Promise<Blob> {\n return new Promise(function (resolve, reject) {\n canvas.toBlob(function (blob: Blob | null) {\n if (blob) {\n resolve(blob);\n } else {\n reject();\n }\n });\n });\n}\n\nexport async function capture(\n maxWidth: number,\n maxHeight: number\n): Promise<Blob> {\n const sourceCanvas = await html2canvas(document.body, {\n logging: false,\n scale: 1,\n width: window.innerWidth,\n height: window.innerHeight,\n foreignObjectRendering: true,\n });\n const targetCanvas = document.createElement(\"canvas\");\n resizeScreenshot(sourceCanvas, targetCanvas, maxWidth, maxHeight);\n const blob = await getCanvasBlob(targetCanvas);\n return blob;\n}\n","export function resizeScreenshot(\n canvas: HTMLCanvasElement,\n targetCanvas: HTMLCanvasElement,\n maxWidth: number,\n maxHeight: number\n): string {\n const targetRatio = maxWidth / maxHeight;\n const { width, height } = canvas;\n const ratio = width / height;\n const wider = ratio >= targetRatio;\n const finalWidth = wider ? maxWidth : maxHeight * ratio;\n const finalHeight = wider ? maxWidth / ratio : maxHeight;\n targetCanvas.width = finalWidth;\n targetCanvas.height = finalHeight;\n\n const ctx = targetCanvas.getContext(\"2d\")!;\n ctx.drawImage(canvas, 0, 0, width, height, 0, 0, finalWidth, finalHeight);\n return targetCanvas.toDataURL();\n}\n"],"names":["collectUsedContracts","storyboard","collection","nodeOrNodes","Set","traverse","node","type","_node$raw","useProvider","raw","add","collect","parseStoryboard","contracts","item","includes","push","customElements","define","createProviderClass","previewProxyOrigin","onClick","event","preventDefault","stopPropagation","eventTargets","iidList","getPossibleBrickTargets","length","window","parent","postMessage","sender","selectBrick","composedPath","onMouseEvent","hoverOnBrick","throttle","leading","onPointerDown","onPointerMove","onPointerLeave","onContextMenu","position","contextMenuOnBrick","x","clientX","y","clientY","targets","target","HTMLElement","dataset","iid","getRealTimeDataAnnotation","value","Array","isArray","connected","getHistory","_getHistory","matchPath","_matchPath","__secret_internals","_internals","flowApi","_flowAPi","isV2","_window$BRICK_NEXT_VE","dll","BRICK_NEXT_VERSIONS","startsWith","getHistoryV2","developHelper","developHelperV2","collectDebugContract","matchPathV2","getContextValue","name","_ref","tplStateStoreId","tplContextId","getAllContextValues","_ref2","v2Map","Object","fromEntries","map","_ref3","k","v","debugDataValue","data","_ref4","e","console","error","contentScrollElement","contentScrollHost","async","connect","previewFromOrigin","options","_secret_internals$ad","_secret_internals","sendMessage","message","hoverIid","hoverAlias","activeIid","activeAlias","sendHighlightBrickOutlines","alias","outlines","getBrickOutlines","highlightType","lastTemplatePreviewSettings","templateId","settings","updateTemplatePreviewSettings","appId","reload","updateSnippetPreviewSettings","JSON","parse","snippetData","updateFormPreviewSettings","formId","formData","history","addEventListener","_data$options","_data$options3","origin","_ref6","forwardedFor","nodes","flat","sendHighlightBricksOutlines","highlightNodes","pos","element","document","elementFromPoint","tagName","isDirection","brick","cursor","parentElement","getPossibleBrickIidList","handleHoverOnIframe","enabled","removeEventListener","updateStoryboardType","_data$options2","newContracts","_getAddedContracts","_ref7","updateStoryboardByRoute","storyboardPatch","updateStoryboardByTemplate","updateStoryboardBySnippet","getAddedContracts","call","isEmpty","updateStoryboard","location","goBack","goForward","maxWidth","maxHeight","sourceCanvas","html2canvas","body","logging","scale","width","innerWidth","height","innerHeight","foreignObjectRendering","targetCanvas","createElement","canvas","targetRatio","ratio","wider","finalWidth","finalHeight","getContext","drawImage","toDataURL","resizeScreenshot","Promise","resolve","reject","toBlob","blob","capture","then","screenshot","handlePreviewData","option","dataType","getRootTplStateStoreId","entries","_ref5","url","previewUrl","substring","basePath","getBasePath","to","routePath","routeExact","syncRouteMatch","contractData","previewOption","undefined","routeId","debugConf","HttpResponseError","responseJson","debugData","scroll","scrollX","scrollY","currentLocation","previewPageMatch","sendLocationChange","loc","createHref","match","pathname","path","exact","mainMountPoint","querySelector","placeholderLoadObserver","MutationObserver","childNodes","firstChild","disconnect","observe","childList","setupContentScroll","_host$shadowRoot","host","shadowRoot","_contentScrollElement","onContentScroll","this","scrollLeft","scrollTop","listen","setupRuntimeValueInspect","_data$match","getLegalRuntimeValue","omit","query","params","memoizedRootTplStateStoreId","setupRealTimeDataInspect","force","_secret_internals$se","_secret_internals2","setRealTimeDataInspectRoot","addRealTimeDataInspectHook","_ref8","changeType","detail","annotation","_ref9","mutationCallback","subtree","isRoot","elements","_contentScrollHost","hasContentScroll","contains","left","top","getBoundingClientRect","getOutlines","getElementsIncludingInShadowDOM","walk","root","candidates","querySelectorAll","_mainMountPoint$first"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"chunks/9027.5ba5abc4.js","mappings":"yMAgCO,SAASA,EAAqBC,GACnC,MAAMC,EArBR,SAAiBC,GACf,MAAMD,EAAa,IAAIE,IAgBvB,OAdAC,EAAAA,EAAAA,GAASF,GAAcG,IACrB,OAAQA,EAAKC,MACX,IAAK,aACL,IAAK,eAAgB,KAAAC,EACnB,MAAMC,EACI,QADOD,EACfF,EAAKI,WAAG,IAAAF,OAAA,EADUA,EAEjBC,YACCA,GACFP,EAAWS,IAAIF,EAEnB,EACF,IAGKP,CACT,CAGqBU,EAAQC,EAAAA,EAAAA,IAAgBZ,IAErCa,EAAY,GAElB,IAAK,MAAMC,KAAQb,EACba,EAAKC,SAAS,MAChBF,EAAUG,KAAKF,GAInB,OAAOD,CACT,CAEAI,eAAeC,OACb,yCACAC,EAAAA,EAAAA,qBAAoBpB,G,yGCvCf,IAAIqB,EAsCX,SAASC,EAAQC,GACfA,EAAMC,iBACND,EAAME,kBAmFR,SAAqBC,GACnB,MAAMC,EAAUC,EAAwBF,GACpCC,EAAQE,OAAS,GACn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C7O,QAClDe,EAAO,eAAiB,kBAE5B,C","sources":["webpack:///./src/data-providers/collect-used-contracts.ts","webpack:///./src/data-providers/preview/inspector.ts","webpack:///./src/data-providers/preview/realTimeDataInspect.ts","webpack:///./src/data-providers/preview/connect.ts","webpack:///./src/data-providers/preview/capture.ts","webpack:///./src/data-providers/preview/resizeScreenshot.ts"],"sourcesContent":["import { createProviderClass } from \"@next-core/utils/general\";\nimport {\n type StoryboardNode,\n parseStoryboard,\n traverse,\n} from \"@next-core/storyboard\";\nimport {\n Storyboard,\n UseProviderResolveConf,\n UseProviderEventHandler,\n} from \"@next-core/types\";\n\nfunction collect(nodeOrNodes: StoryboardNode | StoryboardNode[]): Set<string> {\n const collection = new Set<string>();\n\n traverse(nodeOrNodes, (node) => {\n switch (node.type) {\n case \"Resolvable\":\n case \"EventHandler\": {\n const useProvider = (\n node.raw as UseProviderResolveConf | UseProviderEventHandler\n )?.useProvider;\n if (useProvider) {\n collection.add(useProvider);\n }\n }\n }\n });\n\n return collection;\n}\n\nexport function collectUsedContracts(storyboard: Storyboard): string[] {\n const collection = collect(parseStoryboard(storyboard as any));\n\n const contracts = [];\n\n for (const item of collection) {\n if (item.includes(\"@\")) {\n contracts.push(item);\n }\n }\n\n return contracts;\n}\n\ncustomElements.define(\n \"visual-builder.collect-used-contracts\",\n createProviderClass(collectUsedContracts)\n);\n","// istanbul ignore file: working in progress\n// https://github.com/facebook/react/blob/cae635054e17a6f107a39d328649137b83f25972/packages/react-devtools-shared/src/backend/views/Highlighter/index.js\nimport { throttle } from \"lodash\";\nimport type {\n PreviewMessagePreviewerHoverOnBrick,\n PreviewMessagePreviewerSelectBrick,\n PreviewMessagePreviewerContextMenuOnBrick,\n} from \"./interfaces.js\";\n\nexport let previewProxyOrigin: string;\n\nexport function setPreviewFromOrigin(origin: string): void {\n previewProxyOrigin = origin;\n}\n\nexport function startInspecting(): void {\n registerListeners();\n}\n\nexport function stopInspecting(): void {\n unregisterListeners();\n}\n\nfunction registerListeners(): void {\n window.addEventListener(\"click\", onClick, true);\n window.addEventListener(\"mousedown\", onMouseEvent, true);\n window.addEventListener(\"mouseover\", onMouseEvent, true);\n window.addEventListener(\"mouseup\", onMouseEvent, true);\n window.addEventListener(\"pointerdown\", onPointerDown, true);\n window.addEventListener(\"pointermove\", onPointerMove, true);\n window.addEventListener(\"pointerup\", onMouseEvent, true);\n window.addEventListener(\"pointerleave\", onPointerLeave, true);\n window.addEventListener(\"contextmenu\", onContextMenu, true);\n}\n\nfunction unregisterListeners(): void {\n window.removeEventListener(\"click\", onClick, true);\n window.removeEventListener(\"mousedown\", onMouseEvent, true);\n window.removeEventListener(\"mouseover\", onMouseEvent, true);\n window.removeEventListener(\"mouseup\", onMouseEvent, true);\n window.removeEventListener(\"pointerdown\", onPointerDown, true);\n window.removeEventListener(\"pointermove\", onPointerMove, true);\n window.removeEventListener(\"pointerup\", onMouseEvent, true);\n window.removeEventListener(\"pointerleave\", onPointerLeave, true);\n window.removeEventListener(\"contextmenu\", onContextMenu, true);\n}\n\nfunction onClick(event: MouseEvent): void {\n event.preventDefault();\n event.stopPropagation();\n selectBrick(event.composedPath());\n}\n\nfunction onMouseEvent(event: MouseEvent): void {\n event.preventDefault();\n event.stopPropagation();\n}\n\nconst hoverOnBrick = throttle(\n (eventTargets: EventTarget[]) => {\n const iidList = getPossibleBrickTargets(eventTargets);\n\n if (iidList.length > 0) {\n window.parent.postMessage(\n {\n sender: \"previewer\",\n type: \"hover-on-brick\",\n iidList,\n } as PreviewMessagePreviewerHoverOnBrick,\n previewProxyOrigin\n );\n }\n },\n 100,\n { leading: false }\n);\n\nfunction onPointerDown(event: MouseEvent): void {\n event.preventDefault();\n event.stopPropagation();\n hoverOnBrick(event.composedPath());\n}\n\nfunction onPointerMove(event: MouseEvent): void {\n event.preventDefault();\n event.stopPropagation();\n hoverOnBrick(event.composedPath());\n}\n\nfunction onPointerLeave(event: MouseEvent): void {\n event.preventDefault();\n event.stopPropagation();\n window.parent.postMessage(\n {\n sender: \"previewer\",\n type: \"hover-on-brick\",\n iidList: [],\n } as PreviewMessagePreviewerHoverOnBrick,\n previewProxyOrigin\n );\n}\n\nfunction onContextMenu(event: MouseEvent): void {\n event.preventDefault();\n event.stopPropagation();\n contextMenuOnBrick(event.composedPath(), {\n x: event.clientX,\n y: event.clientY,\n });\n}\n\nfunction contextMenuOnBrick(\n eventTargets: EventTarget[],\n position: {\n x: number;\n y: number;\n }\n): void {\n const iidList = getPossibleBrickTargets(eventTargets);\n if (iidList.length > 0) {\n window.parent.postMessage(\n {\n sender: \"previewer\",\n type: \"context-menu-on-brick\",\n iidList,\n position,\n } as PreviewMessagePreviewerContextMenuOnBrick,\n previewProxyOrigin\n );\n }\n}\n\nfunction selectBrick(eventTargets: EventTarget[]): void {\n const iidList = getPossibleBrickTargets(eventTargets);\n if (iidList.length > 0) {\n window.parent.postMessage(\n {\n sender: \"previewer\",\n type: \"select-brick\",\n iidList,\n } as PreviewMessagePreviewerSelectBrick,\n previewProxyOrigin\n );\n }\n}\n\nexport function getPossibleBrickIidList(brick: HTMLElement): string[] {\n const iidList: string[] = [];\n // Traverse from bottom to up, to find bricks current hover on.\n let cursor: HTMLElement | null = brick;\n while (cursor) {\n if (typeof cursor.dataset.iid === \"string\") {\n iidList.push(cursor.dataset.iid);\n }\n cursor = cursor.parentElement;\n }\n return iidList;\n}\n\nexport function getPossibleBrickTargets(eventTargets: EventTarget[]) {\n const targets: string[] = [];\n for (const target of eventTargets) {\n if (\n target instanceof HTMLElement &&\n typeof target.dataset.iid === \"string\"\n ) {\n targets.push(target.dataset.iid);\n }\n }\n return targets;\n}\n","export function getRealTimeDataAnnotation(value: unknown) {\n const type = typeof value;\n switch (type) {\n case \"string\":\n case \"boolean\":\n case \"number\":\n return {\n type,\n value,\n };\n case \"undefined\":\n return { type };\n }\n if (value === null) {\n return { type: \"null\" };\n }\n if (Array.isArray(value)) {\n return { type: \"array\", length: value.length };\n }\n return { type: \"object\" };\n}\n","import {\n getHistory as _getHistory,\n getBasePath,\n matchPath as _matchPath,\n __secret_internals as _internals,\n type NextLocation,\n} from \"@next-core/runtime\";\nimport { HttpResponseError } from \"@next-core/http\";\nimport { flowApi as _flowAPi } from \"@next-core/easyops-runtime\";\nimport type {\n BrickConf,\n Contract,\n CustomTemplate,\n RouteConf,\n} from \"@next-core/types\";\nimport { isEmpty, throttle, omit } from \"lodash\";\nimport type {\n BrickOutline,\n HighLightNode,\n Position,\n PreviewDataOption,\n PreviewMessageFromPreviewer,\n PreviewMessagePreviewContractUpdate,\n PreviewMessagePreviewDataValueError,\n PreviewMessagePreviewDataValueSuccess,\n PreviewMessagePreviewDebugValueSuccess,\n PreviewMessagePreviewDebugValueError,\n PreviewMessagePreviewerCaptureFailed,\n PreviewMessagePreviewerCaptureOk,\n PreviewMessagePreviewerContentScroll,\n PreviewMessagePreviewerHighlightBrick,\n PreviewMessagePreviewerHighlightContext,\n PreviewMessagePreviewerHoverOnMain,\n PreviewMessagePreviewerRealTimeDataInspectChange,\n PreviewMessagePreviewerRouteMatchChange,\n PreviewMessagePreviewerScroll,\n PreviewMessagePreviewerUrlChange,\n PreviewMessageToPreviewer,\n PreviewSettings,\n PreviewStartOptions,\n PreviewDebugData,\n PreviewMessagePreviewInspectRuntimeValue,\n} from \"./interfaces.js\";\nimport { capture } from \"./capture.js\";\nimport {\n previewProxyOrigin,\n getPossibleBrickIidList,\n setPreviewFromOrigin,\n startInspecting,\n stopInspecting,\n} from \"./inspector.js\";\nimport { collectUsedContracts } from \"../collect-used-contracts.js\";\nimport { getRealTimeDataAnnotation } from \"./realTimeDataInspect.js\";\n\nlet connected = false;\n\ninterface DLL {\n (moduleId: \"tYg3\"): {\n getHistory: typeof _getHistory;\n developHelper: typeof _internals;\n collectDebugContract: typeof flowApi.collectDebugContract;\n };\n (moduleId: \"A+yw\"): {\n matchPath: typeof _matchPath;\n };\n}\n\nlet getHistory = _getHistory;\nlet matchPath = _matchPath;\nlet __secret_internals = _internals;\nlet flowApi = _flowAPi;\nlet isV2 = false;\n\n// istanbul ignore next\n// Make v3 bricks compatible with Brick Next v2.\ntry {\n const dll = (window as unknown as { dll?: DLL }).dll;\n if (\n dll &&\n window.BRICK_NEXT_VERSIONS?.[\"brick-container\"]?.startsWith(\"2.\")\n ) {\n const {\n getHistory: getHistoryV2,\n developHelper: developHelperV2,\n collectDebugContract,\n } = dll(\"tYg3\");\n const { matchPath: matchPathV2 } = dll(\"A+yw\");\n getHistory = getHistoryV2;\n matchPath = matchPathV2;\n // The `__secret_internals` of v3 has pretty the same API as\n // `developHelper` of v2, especially those for preview usage.\n __secret_internals = {\n ...developHelperV2,\n getContextValue(name, { tplStateStoreId }) {\n return developHelperV2.getContextValue(name, {\n tplContextId: tplStateStoreId,\n } as any);\n },\n getAllContextValues({ tplStateStoreId }) {\n // V3 returns an object of key-value.\n // While v2 returns a map of ContextItem.\n const v2Map = developHelperV2.getAllContextValues({\n tplContextId: tplStateStoreId,\n } as any) as unknown as Map<string, { value: unknown }>;\n return Object.fromEntries(\n [...v2Map].map(([k, v]) => [k, (v as any).value])\n );\n },\n debugDataValue(data, { tplStateStoreId }) {\n return developHelperV2.debugDataValue(data, {\n tplContextId: tplStateStoreId,\n } as any);\n },\n };\n\n flowApi = {\n collectDebugContract,\n } as any;\n isV2 = true;\n }\n} catch (e) {\n // eslint-disable-next-line no-console\n console.error(\"Try to use v2 runtime APIs failed:\", e);\n}\n\nlet contentScrollElement: Element | null = null;\nlet contentScrollHost: Element | null = null;\n\nexport default async function connect(\n previewFromOrigin: string,\n options: PreviewStartOptions\n) {\n if (connected) {\n return;\n }\n connected = true;\n\n const sendMessage = <T extends PreviewMessageFromPreviewer>(\n message: Omit<T, \"sender\">\n ): void => {\n window.parent.postMessage(\n {\n sender: \"previewer\",\n ...message,\n },\n previewFromOrigin\n );\n };\n\n sendMessage({ type: \"preview-started\" });\n setPreviewFromOrigin(previewFromOrigin);\n\n let hoverIid: string;\n let hoverAlias: string;\n let activeIid: string;\n let activeAlias: string;\n\n const handleHoverOnIframe = (pos: Position): void => {\n const element = document.elementFromPoint(pos.x, pos.y);\n if (element?.tagName === \"BODY\") {\n window.parent.postMessage(\n {\n sender: \"previewer\",\n type: \"hover-on-main\",\n isDirection: true,\n position: {\n x: pos.x,\n y: pos.y,\n },\n } as PreviewMessagePreviewerHoverOnMain,\n previewProxyOrigin\n );\n } else {\n const iidList = getPossibleBrickIidList(element as HTMLElement);\n window.parent.postMessage(\n {\n sender: \"previewer\",\n type: \"hover-on-brick\",\n iidList,\n isDirection: true,\n position: {\n x: pos.x,\n y: pos.y,\n },\n },\n previewProxyOrigin\n );\n }\n };\n\n const sendHighlightBrickOutlines = (\n type: \"hover\" | \"active\",\n iid: string,\n alias: string\n ): void => {\n const outlines = getBrickOutlines(iid);\n sendMessage<PreviewMessagePreviewerHighlightBrick>({\n type: \"highlight-brick\",\n highlightType: type,\n outlines,\n iid: iid,\n alias: alias,\n });\n };\n\n const sendHighlightBricksOutlines = (nodes: HighLightNode[]): void => {\n const outlines = nodes\n .map((node) => getBrickOutlines(node.iid, node.alias))\n .flat();\n sendMessage<PreviewMessagePreviewerHighlightContext>({\n type: \"highlight-context\",\n outlines,\n });\n };\n\n let lastTemplatePreviewSettings: PreviewSettings | undefined;\n if (options.templateId) {\n lastTemplatePreviewSettings = options.settings;\n }\n\n const updateTemplatePreviewSettings = (): void => {\n __secret_internals.updateTemplatePreviewSettings(\n options.appId,\n options.templateId!,\n lastTemplatePreviewSettings\n );\n getHistory().reload();\n };\n\n const updateSnippetPreviewSettings = (): void => {\n __secret_internals.updateSnippetPreviewSettings(\n options.appId,\n JSON.parse(options.snippetData)\n );\n getHistory().reload();\n };\n\n const updateFormPreviewSettings = (): void => {\n (__secret_internals as any).updateFormPreviewSettings(\n options.appId,\n options.formId,\n options.formData\n );\n getHistory().reload();\n };\n\n const handlePreviewData = (name: string, option: PreviewDataOption): void => {\n try {\n const { dataType } = option;\n let tplStateStoreId;\n\n if (dataType === \"state\") {\n tplStateStoreId = getRootTplStateStoreId();\n\n if (!tplStateStoreId) {\n sendMessage<PreviewMessagePreviewDataValueError>({\n type: \"inspect-data-value-error\",\n data: {\n error: {\n message:\n \"tplStateStoreId not found, unable to preview STATE value\",\n },\n },\n });\n\n return;\n }\n }\n\n let value, type: PreviewMessagePreviewDataValueSuccess[\"type\"];\n if (name) {\n type = \"inspect-single-data-value-success\";\n value = __secret_internals.getContextValue(name, {\n tplStateStoreId,\n });\n } else {\n type = \"inspect-all-data-values-success\";\n const data = __secret_internals.getAllContextValues({\n tplStateStoreId,\n });\n value = Object.entries(data).map(([name, value]) => ({ name, value }));\n }\n\n sendMessage<PreviewMessagePreviewDataValueSuccess>({\n type,\n data: {\n name,\n value,\n },\n });\n\n // istanbul ignore next\n } catch (error) {\n sendMessage<PreviewMessagePreviewDataValueError>({\n type: \"inspect-data-value-error\",\n data: {\n message: (error as Error).message,\n },\n });\n }\n };\n\n const debugDataValue = async (\n data: PreviewDebugData,\n contractData: Contract,\n previewOption: PreviewDataOption\n ) => {\n try {\n if (contractData) {\n flowApi.collectDebugContract([contractData]);\n }\n const value = await __secret_internals.debugDataValue(data, {\n tplStateStoreId:\n previewOption.dataType === \"state\"\n ? getRootTplStateStoreId()\n : undefined,\n routeId: options.routeId,\n });\n\n sendMessage<PreviewMessagePreviewDebugValueSuccess>({\n type: \"debug-data-value-success\",\n data: {\n debugConf: data,\n value,\n },\n });\n } catch (error) {\n sendMessage<PreviewMessagePreviewDebugValueError>({\n type: \"debug-data-value-error\",\n data:\n error instanceof HttpResponseError\n ? error.responseJson\n : { message: (error as Error).message },\n });\n }\n };\n\n const history = getHistory();\n\n window.addEventListener(\n \"message\",\n async ({ data, origin }: MessageEvent<PreviewMessageToPreviewer>) => {\n if (\n origin !== previewFromOrigin ||\n !data ||\n data.sender !== \"preview-container\"\n ) {\n return;\n }\n if (data.forwardedFor === \"builder\") {\n switch (data.type) {\n case \"hover-on-brick\":\n hoverIid = data.iid;\n hoverAlias = data.alias;\n sendHighlightBrickOutlines(\"hover\", data.iid, data.alias);\n break;\n case \"hover-on-main\":\n sendHighlightBrickOutlines(\"hover\", \"#main-mount-point\", \"root\");\n break;\n case \"hover-on-context\":\n sendHighlightBricksOutlines(data.highlightNodes);\n break;\n case \"select-brick\":\n activeIid = data.iid;\n activeAlias = data.alias;\n sendHighlightBrickOutlines(\"active\", data.iid, data.alias);\n break;\n case \"hover-on-iframe\":\n handleHoverOnIframe(data.position);\n break;\n }\n } else\n switch (data.type) {\n case \"toggle-inspecting\":\n data.enabled ? startInspecting() : stopInspecting();\n break;\n case \"refresh\":\n if (data.options?.updateStoryboardType) {\n if (data.options.updateStoryboardType === \"route\") {\n __secret_internals.updateStoryboardByRoute(\n options.appId,\n data.storyboardPatch as RouteConf\n );\n } else if (data.options.updateStoryboardType === \"template\") {\n __secret_internals.updateStoryboardByTemplate(\n options.appId,\n data.storyboardPatch as CustomTemplate,\n data.options.settings\n );\n } else if (data.options.updateStoryboardType === \"snippet\") {\n __secret_internals.updateStoryboardBySnippet(\n options.appId,\n data.storyboardPatch as {\n snippetId: string;\n bricks: BrickConf[];\n }\n );\n } else if (data.options.updateStoryboardType === \"form\") {\n (__secret_internals as any).updateFormPreviewSettings(\n options.appId,\n options.formId,\n data.storyboardPatch\n );\n }\n\n let newContracts;\n if (data.options?.updateStoryboardType !== \"form\") {\n newContracts = await (\n __secret_internals as any\n ).getAddedContracts?.(data.storyboardPatch, {\n appId: options.appId,\n updateStoryboardType: data.options.updateStoryboardType,\n formId: options.formId,\n collectUsedContracts,\n });\n }\n\n if (!isEmpty(newContracts)) {\n sendMessage<PreviewMessagePreviewContractUpdate>({\n type: \"contract-update\",\n data: {\n add: newContracts,\n },\n });\n } else {\n getHistory().reload();\n }\n\n break;\n }\n __secret_internals.updateStoryboard(\n options.appId,\n data.storyboardPatch\n );\n if (options.templateId) {\n lastTemplatePreviewSettings = data.settings;\n updateTemplatePreviewSettings();\n } else if (options.formId || options.formData) {\n updateFormPreviewSettings();\n } else if (data.options?.snippetData) {\n options.snippetData = data.options.snippetData;\n updateSnippetPreviewSettings();\n } else {\n getHistory().reload();\n }\n break;\n case \"reload\":\n location.reload();\n break;\n case \"back\":\n history.goBack();\n break;\n case \"forward\":\n history.goForward();\n break;\n case \"capture\":\n capture(data.maxWidth, data.maxHeight).then(\n (screenshot) => {\n sendMessage<PreviewMessagePreviewerCaptureOk>({\n type: \"capture-ok\",\n screenshot,\n });\n },\n () => {\n sendMessage<PreviewMessagePreviewerCaptureFailed>({\n type: \"capture-failed\",\n });\n }\n );\n break;\n case \"inspect-data-value\":\n handlePreviewData(data.name, data.option);\n break;\n case \"update-preview-url\": {\n // Remove origin first.\n const url = data.previewUrl.startsWith(window.origin)\n ? data.previewUrl.substring(window.origin.length)\n : data.previewUrl;\n // Then remove base path.\n const basePath = getBasePath();\n const to = url.startsWith(basePath)\n ? url.substring(basePath.length - 1)\n : url;\n getHistory().push(to);\n break;\n }\n case \"update-preview-route\": {\n options.routePath = data.routePath;\n options.routeExact = data.routeExact;\n syncRouteMatch();\n break;\n }\n case \"debug-data-value\":\n debugDataValue(data.debugData, data.contractData, data.options);\n break;\n /* case \"excute-proxy-method\": {\n const [ref, method, args = []] = data.proxyMethodArgs;\n try {\n const result = document.body.querySelector(ref)[method](...args);\n window.parent.postMessage({\n sender: \"previewer\",\n type: \"excute-proxy-method-success\",\n data: { method: method, res: result },\n });\n } catch (err) {\n window.parent.postMessage({\n sender: \"previewer\",\n type: \"excute-proxy-method-error\",\n data: { method: method, res: err.message },\n });\n }\n break;\n } */\n }\n }\n );\n\n window.addEventListener(\"scroll\", () => {\n sendMessage<PreviewMessagePreviewerScroll>({\n type: \"scroll\",\n scroll: {\n x: window.scrollX,\n y: window.scrollY,\n },\n });\n });\n\n let previewPageMatch = true;\n let currentLocation: NextLocation;\n const sendLocationChange = (loc: NextLocation): void => {\n sendMessage<PreviewMessagePreviewerUrlChange>({\n type: \"url-change\",\n url: location.origin + history.createHref(loc),\n });\n currentLocation = loc;\n syncRouteMatch();\n };\n\n function syncRouteMatch() {\n if (options.routePath) {\n const match = !!matchPath(currentLocation.pathname, {\n path: options.routePath,\n exact: options.routeExact,\n });\n sendMessage<PreviewMessagePreviewerRouteMatchChange>({\n type: \"route-match-change\",\n match,\n });\n\n // Re-update template preview settings once match route again (typically after login).\n if (options.templateId && !previewPageMatch && match) {\n const mainMountPoint = document.querySelector(\"#main-mount-point\")!;\n const placeholderLoadObserver = new MutationObserver(() => {\n // We observe when the placeholder is appeared.\n if (\n mainMountPoint.childNodes.length === 1 &&\n (mainMountPoint.firstChild as HTMLElement).tagName === \"SPAN\" &&\n mainMountPoint.firstChild!.childNodes.length === 0\n ) {\n updateTemplatePreviewSettings();\n placeholderLoadObserver.disconnect();\n }\n });\n placeholderLoadObserver.observe(mainMountPoint, { childList: true });\n }\n if (options.formId && !previewPageMatch && match) {\n const mainMountPoint = document.querySelector(\"#main-mount-point\");\n const placeholderLoadObserver = new MutationObserver(() => {\n // We observe when the placeholder is appeared.\n if (\n mainMountPoint.childNodes.length === 1 &&\n (mainMountPoint.firstChild as HTMLElement).tagName === \"SPAN\" &&\n mainMountPoint.firstChild.childNodes.length === 0\n ) {\n updateFormPreviewSettings();\n placeholderLoadObserver.disconnect();\n }\n });\n placeholderLoadObserver.observe(mainMountPoint, { childList: true });\n }\n if (options.snippetData && !previewPageMatch && match) {\n const mainMountPoint = document.querySelector(\"#main-mount-point\")!;\n const placeholderLoadObserver = new MutationObserver(() => {\n // We observe when the placeholder is appeared.\n if (\n mainMountPoint.childNodes.length === 1 &&\n (mainMountPoint.firstChild as HTMLElement).tagName === \"SPAN\" &&\n mainMountPoint.firstChild!.childNodes.length === 0\n ) {\n updateSnippetPreviewSettings();\n placeholderLoadObserver.disconnect();\n }\n });\n placeholderLoadObserver.observe(mainMountPoint, { childList: true });\n }\n previewPageMatch = match;\n }\n }\n\n sendLocationChange(history.location);\n\n history.listen(sendLocationChange);\n\n if (options.templateId) {\n updateTemplatePreviewSettings();\n }\n\n if (options.formId || options.formData) {\n updateFormPreviewSettings();\n }\n\n if (options.snippetData) {\n updateSnippetPreviewSettings();\n }\n\n function setupContentScroll() {\n const host = document.querySelector(\"eo-page-view\");\n const element = host?.shadowRoot?.querySelector(\".content\") ?? null;\n if (element !== contentScrollElement) {\n contentScrollElement?.removeEventListener(\"scroll\", onContentScroll);\n element?.addEventListener(\"scroll\", onContentScroll);\n contentScrollElement = element;\n contentScrollHost = host;\n }\n }\n\n function onContentScroll(this: Element) {\n sendMessage<PreviewMessagePreviewerContentScroll>({\n type: \"content-scroll\",\n scroll: {\n x: this.scrollLeft,\n y: this.scrollTop,\n },\n });\n }\n\n const setupRuntimeValueInspect = () => {\n const routeId = options.routeId;\n\n const data = __secret_internals.getLegalRuntimeValue({ routeId });\n sendMessage<PreviewMessagePreviewInspectRuntimeValue>({\n type: \"inspect-runtime-data-value\",\n data: {\n ...omit(data, \"query\"),\n query: data.query ? Object.fromEntries(data.query.entries()) : {},\n path: data.match?.params,\n },\n });\n };\n\n __secret_internals.addRealTimeDataInspectHook?.(\n ({ changeType, tplStateStoreId, detail }) => {\n sendMessage<PreviewMessagePreviewerRealTimeDataInspectChange>({\n type: \"real-time-data-inspect-change\",\n changeType,\n tplStateStoreId,\n detail:\n changeType === \"update\"\n ? {\n name: detail.name,\n annotation: getRealTimeDataAnnotation(detail.value),\n }\n : {\n data: Object.fromEntries(\n Object.entries(detail.data).map(([k, v]) => [\n k,\n getRealTimeDataAnnotation(v),\n ])\n ),\n },\n });\n }\n );\n\n let memoizedRootTplStateStoreId: string | undefined;\n\n function setupRealTimeDataInspect(force?: boolean) {\n const tplStateStoreId = options.templateId\n ? getRootTplStateStoreId()\n : undefined;\n if (memoizedRootTplStateStoreId !== tplStateStoreId || force) {\n memoizedRootTplStateStoreId = tplStateStoreId;\n __secret_internals.setRealTimeDataInspectRoot?.({\n tplStateStoreId,\n });\n }\n }\n\n window.addEventListener(\"route.render\", () => {\n setupRealTimeDataInspect(true);\n setupRuntimeValueInspect();\n });\n\n setupContentScroll();\n setupRealTimeDataInspect(true);\n setupRuntimeValueInspect();\n\n const mutationCallback = (): void => {\n setupContentScroll();\n setupRealTimeDataInspect();\n if (hoverIid) {\n sendHighlightBrickOutlines(\"hover\", hoverIid, hoverAlias);\n }\n if (activeIid) {\n sendHighlightBrickOutlines(\"active\", activeIid, activeAlias);\n }\n };\n const mutationObserver = new MutationObserver(\n throttle(mutationCallback, 100, { leading: false })\n );\n mutationObserver.observe(document.body, { subtree: true, childList: true });\n}\n\nfunction getBrickOutlines(iid: string, alias?: string): BrickOutline[] {\n if (!iid) {\n return [];\n }\n const isRoot = iid.includes(\"#\");\n const elements = getElementsIncludingInShadowDOM(iid, isRoot);\n const outlines = getOutlines(elements, alias);\n return isRoot\n ? outlines.map((item) => ({\n ...item,\n height: window.innerHeight - item.top,\n }))\n : outlines;\n}\n\nexport function getElementsIncludingInShadowDOM(\n iid: string,\n isRoot?: boolean\n): HTMLElement[] {\n const elements: HTMLElement[] = [];\n\n function walk(root: Document | ShadowRoot) {\n const candidates = root.querySelectorAll<HTMLElement>(\n isRoot ? iid : `[data-iid=\"${iid}\"]`\n );\n elements.push(...candidates);\n\n // If elements are found in the document, we should stop searching in shadow DOM.\n if (root === document && candidates.length > 0) {\n return;\n }\n\n // These useBrick in v3 bricks will be inside shadow DOM.\n for (const item of root.querySelectorAll(\"*\")) {\n if (item.shadowRoot) {\n walk(item.shadowRoot);\n }\n }\n }\n\n walk(document);\n\n return elements;\n}\n\nfunction getOutlines(elements: HTMLElement[], alias?: string): BrickOutline[] {\n return elements.map((element) => {\n const hasContentScroll = contentScrollHost?.contains(element);\n const { width, height, left, top } = element.getBoundingClientRect();\n return {\n width,\n height,\n left:\n left +\n window.scrollX +\n (hasContentScroll ? contentScrollElement.scrollLeft : 0),\n top:\n top +\n window.scrollY +\n (hasContentScroll ? contentScrollElement.scrollTop : 0),\n alias,\n hasContentScroll,\n };\n });\n}\n\nfunction getRootTplStateStoreId(): string | undefined {\n const mainMountPoint = document.querySelector(\"#main-mount-point\")!;\n\n return (mainMountPoint?.firstChild as HTMLElement)?.dataset[\n isV2 ? \"tplContextId\" : \"tplStateStoreId\"\n ];\n}\n","// istanbul ignore file: nothing logical except calling html2canvas.\nimport html2canvas from \"html2canvas\";\nimport { resizeScreenshot } from \"./resizeScreenshot.js\";\n\nfunction getCanvasBlob(canvas: HTMLCanvasElement): Promise<Blob> {\n return new Promise(function (resolve, reject) {\n canvas.toBlob(function (blob: Blob | null) {\n if (blob) {\n resolve(blob);\n } else {\n reject();\n }\n });\n });\n}\n\nexport async function capture(\n maxWidth: number,\n maxHeight: number\n): Promise<Blob> {\n const sourceCanvas = await html2canvas(document.body, {\n logging: false,\n scale: 1,\n width: window.innerWidth,\n height: window.innerHeight,\n foreignObjectRendering: true,\n });\n const targetCanvas = document.createElement(\"canvas\");\n resizeScreenshot(sourceCanvas, targetCanvas, maxWidth, maxHeight);\n const blob = await getCanvasBlob(targetCanvas);\n return blob;\n}\n","export function resizeScreenshot(\n canvas: HTMLCanvasElement,\n targetCanvas: HTMLCanvasElement,\n maxWidth: number,\n maxHeight: number\n): string {\n const targetRatio = maxWidth / maxHeight;\n const { width, height } = canvas;\n const ratio = width / height;\n const wider = ratio >= targetRatio;\n const finalWidth = wider ? maxWidth : maxHeight * ratio;\n const finalHeight = wider ? maxWidth / ratio : maxHeight;\n targetCanvas.width = finalWidth;\n targetCanvas.height = finalHeight;\n\n const ctx = targetCanvas.getContext(\"2d\")!;\n ctx.drawImage(canvas, 0, 0, width, height, 0, 0, finalWidth, finalHeight);\n return targetCanvas.toDataURL();\n}\n"],"names":["collectUsedContracts","storyboard","collection","nodeOrNodes","Set","traverse","node","type","_node$raw","useProvider","raw","add","collect","parseStoryboard","contracts","item","includes","push","customElements","define","createProviderClass","previewProxyOrigin","onClick","event","preventDefault","stopPropagation","eventTargets","iidList","getPossibleBrickTargets","length","window","parent","postMessage","sender","selectBrick","composedPath","onMouseEvent","hoverOnBrick","throttle","leading","onPointerDown","onPointerMove","onPointerLeave","onContextMenu","position","contextMenuOnBrick","x","clientX","y","clientY","targets","target","HTMLElement","dataset","iid","getRealTimeDataAnnotation","value","Array","isArray","connected","getHistory","_getHistory","matchPath","_matchPath","__secret_internals","_internals","flowApi","_flowAPi","isV2","_window$BRICK_NEXT_VE","dll","BRICK_NEXT_VERSIONS","startsWith","getHistoryV2","developHelper","developHelperV2","collectDebugContract","matchPathV2","getContextValue","name","_ref","tplStateStoreId","tplContextId","getAllContextValues","_ref2","v2Map","Object","fromEntries","map","_ref3","k","v","debugDataValue","data","_ref4","e","console","error","contentScrollElement","contentScrollHost","async","connect","previewFromOrigin","options","_secret_internals$ad","_secret_internals","sendMessage","message","hoverIid","hoverAlias","activeIid","activeAlias","sendHighlightBrickOutlines","alias","outlines","getBrickOutlines","highlightType","lastTemplatePreviewSettings","templateId","settings","updateTemplatePreviewSettings","appId","reload","updateSnippetPreviewSettings","JSON","parse","snippetData","updateFormPreviewSettings","formId","formData","history","addEventListener","_data$options","_data$options3","origin","_ref6","forwardedFor","nodes","flat","sendHighlightBricksOutlines","highlightNodes","pos","element","document","elementFromPoint","tagName","isDirection","brick","cursor","parentElement","getPossibleBrickIidList","handleHoverOnIframe","enabled","removeEventListener","updateStoryboardType","_data$options2","newContracts","_getAddedContracts","_ref7","updateStoryboardByRoute","storyboardPatch","updateStoryboardByTemplate","updateStoryboardBySnippet","getAddedContracts","call","isEmpty","updateStoryboard","location","goBack","goForward","maxWidth","maxHeight","sourceCanvas","html2canvas","body","logging","scale","width","innerWidth","height","innerHeight","foreignObjectRendering","targetCanvas","createElement","canvas","targetRatio","ratio","wider","finalWidth","finalHeight","getContext","drawImage","toDataURL","resizeScreenshot","Promise","resolve","reject","toBlob","blob","capture","then","screenshot","handlePreviewData","option","dataType","getRootTplStateStoreId","entries","_ref5","url","previewUrl","substring","basePath","getBasePath","to","routePath","routeExact","syncRouteMatch","contractData","previewOption","undefined","routeId","debugConf","HttpResponseError","responseJson","debugData","scroll","scrollX","scrollY","currentLocation","previewPageMatch","sendLocationChange","loc","createHref","match","pathname","path","exact","mainMountPoint","querySelector","placeholderLoadObserver","MutationObserver","childNodes","firstChild","disconnect","observe","childList","setupContentScroll","_host$shadowRoot","host","shadowRoot","_contentScrollElement","onContentScroll","this","scrollLeft","scrollTop","listen","setupRuntimeValueInspect","_data$match","getLegalRuntimeValue","omit","query","params","memoizedRootTplStateStoreId","setupRealTimeDataInspect","force","_secret_internals$se","_secret_internals2","setRealTimeDataInspectRoot","addRealTimeDataInspectHook","_ref8","changeType","detail","annotation","_ref9","mutationCallback","subtree","isRoot","elements","_contentScrollHost","hasContentScroll","contains","left","top","getBoundingClientRect","getOutlines","getElementsIncludingInShadowDOM","walk","root","candidates","querySelectorAll","_mainMountPoint$first"],"sourceRoot":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";(globalThis.webpackChunk_next_bricks_visual_builder=globalThis.webpackChunk_next_bricks_visual_builder||[]).push([[9080],{2803:(e,t,o)=>{o.d(t,{M:()=>x});var n=o(9575),a=o(8769),r=o.n(a),l=o(9708),i=o(1389),p=o(7091),s=o(3373),c=o.n(s),m=o(1030),d=o(5908),u=o(1431),v=o(1732),b=o.n(v);const f=(0,i.wrapBrick)("eo-icon"),h=(0,i.wrapBrick)("eo-tooltip");function x(e){var t;const o=(0,p.mN)(),i=(0,p.Mt)(),s=(0,p.X0)(),v=(0,p.Ov)(),[x,g]=(0,a.useState)("CodeEditor"===(null===(t=i.component)||void 0===t?void 0:t[0])?"advanced":"normal"),y=(0,a.useMemo)((()=>"advanced"===x),[x]),E=(0,a.useRef)([]),C=(0,a.useCallback)((()=>{const e=E.current,t=y?"normal":"advanced",n="advanced"===t;g(t),i.setComponent(n?"CodeEditor":e[0],{...n?{...v??{},lineNumbers:"off",glyphMargin:!1}:e[1]});const a=o.getValuesIn(i.props.name);if(n&&(0,m.isObject)(a))o.setInitialValues({[i.props.name]:b().safeDump(a)});else if(!n&&a&&"string"==typeof a){let e;try{e=b().load(a)}catch{e=null}o.setInitialValues({[i.props.name]:e},"overwrite")}}),[o,i,y,v]);return(0,p.Uf)((()=>{(0,d.J4)(i.props.name,(e=>{let{value:t}=e;"string"==typeof t&&(0,u.isEvaluable)(t)&&(g("advanced"),i.setComponent("CodeEditor",{...v??{},lineNumbers:"off",glyphMargin:!1}))}))})),(0,a.useEffect)((()=>{E.current=[s["x-component"],s["x-component-props"]]}),[s]),r().createElement("div",{className:"advanced-form-item"},r().createElement(l.eI,(0,n.A)({},e,{layout:y?null:e.layout||"vertical"}),e.children),r().createElement("div",{className:"advanced-mode-check-wrapper"},r().createElement(h,{content:"normal"===x?"使用表达式":"关闭表达式"},r().createElement(f,{className:c()({isActive:y}),lib:"fa",icon:"code",onClick:C}))))}},3768:(e,t,o)=>{o.d(t,{H:()=>r});var n=o(8769),a=o.n(n);function r(e){return a().createElement("div",{className:"custom-category-title"},e.text)}},6110:(e,t,o)=>{o.d(t,{i:()=>I});var n=o(9708),a=o(9646),r=o(7070),l=o(8769),i=o.n(l),p=o(2591),s=o.n(p),c=o(1740),m=o.n(c),d=o(8128),u=o.n(d),v=o(855),b=o.n(v),f=o(3051),h=o.n(f),x=o(3656),g=o.n(x),y=o(3607),E={};E.styleTagTransform=g(),E.setAttributes=b(),E.insert=u().bind(null,"head"),E.domAPI=m(),E.insertStyleElement=h(),s()(y.A,E);const C=y.A&&y.A.locals?y.A.locals:void 0;var A=o(3373),k=o.n(A),W=function(e){return e[e.top=0]="top",e[e.right=1]="right",e[e.bottom=2]="bottom",e[e.left=3]="left",e}(W||{});function I(e){let{onChange:t,value:o,mode:p}=e;const[s,c]=(0,l.useState)(),[m,d]=(0,l.useState)(!1),[u,v]=(0,l.useState)(),b=(0,l.useMemo)((()=>"in"===p),[p]),f=e=>{v(e)},h=()=>{v(null)},x=(0,l.useCallback)(((e,n)=>{const a=n.match(/\d+/),r=Number(null!==a?a[0]:0),l=m?`${r}px`:`${(o??"0px 0px 0px 0px").match(/(\d+px)/g).map(((t,o)=>W[e]===o?`${r}px`:t)).join(" ")}`;t(l)}),[m,t,o]),g=e=>{d(e)},y=(0,l.useCallback)((e=>{const t=(e??"0px 0px 0px 0px").match(/(\d+)/g);1===t.length?(d(!0),c({top:t[0],right:t[0],bottom:t[0],left:t[0]})):c({top:t[0],right:t[1],bottom:t[2]??t[0],left:t[3]??t[1]})}),[]);return(0,l.useEffect)((()=>{y(o)}),[o,y]),i().createElement("div",{className:C.boxSizeComponent},i().createElement("div",{className:C.leftWrapper},i().createElement("div",{className:C.outBox},i().createElement("div",{className:C.inBox,style:{position:b?"relative":"initial"}},i().createElement("div",{className:k()(C.top,C.line,C.vertical,{[C.active]:"top"===u||m})}),i().createElement("div",{className:k()(C.right,C.line,C.horizontal,{[C.active]:"right"===u||m})}),i().createElement("div",{className:k()(C.left,C.line,C.horizontal,{[C.active]:"left"===u||m})}),i().createElement("div",{className:k()(C.bottom,C.line,C.vertical,{[C.active]:"bottom"===u||m})}),i().createElement("div",{className:"connect-btn"},m?i().createElement(a.A,{style:{color:"var(--color-brand)"},onClick:()=>g(!1)}):i().createElement(r.A,{onClick:()=>g(!0)}))))),i().createElement("div",{className:C.rightWrapper},i().createElement("div",{className:C.inputWrapper},i().createElement(n.pd,{prefix:"上",placeholder:"0",value:null==s?void 0:s.top,onFocus:()=>f("top"),onBlur:h,onChange:e=>x("top",e.target.value)}),i().createElement(n.pd,{prefix:"左",placeholder:"0",value:null==s?void 0:s.left,onFocus:()=>f("left"),onChange:e=>x("left",e.target.value),onBlur:h})),i().createElement("div",{className:C.inputWrapper},i().createElement(n.pd,{prefix:"下",placeholder:"0",value:null==s?void 0:s.bottom,onFocus:()=>f("bottom"),onBlur:h,onChange:e=>x("bottom",e.target.value)}),i().createElement(n.pd,{prefix:"右",placeholder:"0",value:null==s?void 0:s.right,onFocus:()=>f("right"),onBlur:h,onChange:e=>x("right",e.target.value)}))))}},3824:(e,t,o)=>{o.d(t,{S:()=>m});var n=o(9575),a=o(8769),r=o.n(a),l=o(1389),i=o(1732),p=o.n(i),s=o(1030);const c=(0,l.wrapBrick)("vs.code-editor",{onChange:"code.change",tokenClick:"token.click"});function m(e){const[t,o]=(0,a.useState)(),[l,i]=(0,a.useState)(),m=(0,a.useCallback)((t=>{var o;i(t.detail?t.detail:void 0);const n=t.detail?p().safeLoad(t.detail):void 0;null==e||null===(o=e.onChange)||void 0===o||o.call(e,n)}),[e]);return(0,a.useEffect)((()=>{if(e.value&&!t){let t=e.value;t&&"string"!=typeof t&&(t=(0,s.isEmpty)(t)?"":p().safeDump(Array.isArray(t)?t:(0,s.omit)(t,(0,s.isEmpty)(t.style)?["style"]:[]),{skipInvalid:!0})),o(t)}}),[e.value,t]),r().createElement(c,(0,n.A)({minLines:e.minLines??1,automaticLayout:"fit-content",language:"brick_next_yaml",theme:"vs-dark"},e,{value:l??t,onChange:m}))}},5067:(e,t,o)=>{o.d(t,{h:()=>d});var n=o(9575),a=o(8769),r=o.n(a),l=o(5346),i=o(7856);const p=Object.entries({amber:"#f7bf02",yellow:"#fadb14",orange:"#e38306",pink:"#ff1a79",red:"#f24c25",blue:"#1a7aff",indigo:"#3844e8","deep-purple":"#6641f9","gray-blue":"#778dc3",purple:"#893ad8",cyan:"#21d4f3",teal:"#1dc897",green:"#08BF33"}).map((e=>{let[t,o]=e;return{label:t,colors:(0,i.cM)(o)}})),s=e=>[{label:"系统默认",colors:e.map((e=>e.colors)).flat()}],c=(e,t)=>{let o=t;return e.forEach((e=>{const t=e.label,n=e.colors.findIndex((e=>"string"==typeof e?e===o:e.toHsbString()===o));n>=0&&(o=`var(--palette-${t}-${n+1})`)})),o},m=(e,t)=>{const[,o,n]=t.match(/^var\(--palette-(\w+)-(\d+)\)$/)??[];let a=t;return o&&n&&e.forEach((e=>{const t=e.colors[Number(n)-1];e.label===o&&t&&(a="string"==typeof t?t:t.toHsbString())})),a};function d(e){const[t,o]=(0,a.useState)(),i=(0,a.useMemo)((()=>s(p)),[]);return(0,a.useEffect)((()=>{if(e.value){const t=m(p,e.value);o(t)}else o(e.value??"")}),[e.value]),r().createElement(l.A,(0,n.A)({getPopupContainer:()=>document.body,showText:!0,presets:i},e,{value:t,onChange:(t,o)=>{var n,a;n=o,null===(a=e.onChange)||void 0===a||a.call(e,c(p,n))}}))}},5944:(e,t,o)=>{o.d(t,{F:()=>B});var n=o(8769),a=o.n(n),r=o(2591),l=o.n(r),i=o(1740),p=o.n(i),s=o(8128),c=o.n(s),m=o(855),d=o.n(m),u=o(3051),v=o.n(u),b=o(3656),f=o.n(b),h=o(803),x={};x.styleTagTransform=f(),x.setAttributes=d(),x.insert=c().bind(null,"head"),x.domAPI=p(),x.insertStyleElement=v(),l()(h.A,x);const g=h.A&&h.A.locals?h.A.locals:void 0;var y=o(1469),E=o(7091),C=o(9650),A=o(8144),k=o(3995),W=o(2080),I=o(5908),T=o(1030);const S="$custom_wrapper",w="$option_id";function B(e){let{schema:t,displayLabel:o,value:r,onChange:l}=e;const[i,p]=(0,n.useState)(),[s,c]=(0,n.useState)(!1),[m,d]=(0,n.useState)([]),u=(0,n.useMemo)((()=>(0,k.cV)({name:S,type:"void",children:t},{isDefault:!1})),[t]),v=(0,n.useMemo)((()=>(0,I.DG)()),[]),b=(0,n.useCallback)((()=>{let e=m;e=i?m.map((e=>e[w]===i[w]?v.values:e)):m.concat(v.values),d(e),l(e.map((e=>(0,T.omit)(e,[w])))),c(!1)}),[v,l,m,i]),f=()=>{c(!1)},h=(0,n.useCallback)((()=>{const e=m.filter((e=>e[w]!==i[w]));d(e),l(e.map((e=>(0,T.omit)(e,[w])))),c(!1)}),[m,i,l]);return(0,n.useEffect)((()=>{r&&d(r.map((e=>({...e,[w]:Math.random()}))))}),[r]),a().createElement("div",{className:g.actionOptionsWrapper},a().createElement(C.A,{title:(i?"编辑":"新增")+"数据",open:s,onOk:b,onCancel:f,footer:()=>a().createElement("div",{className:g.modalFooter},a().createElement("div",null,i&&a().createElement(A.Ay,{danger:!0,type:"primary",onClick:h},"删除")),a().createElement("div",null,a().createElement(A.Ay,{type:"text",onClick:f},"取消"),a().createElement(A.Ay,{type:"primary",onClick:b},"确认")))},a().createElement(E.Op,{form:v},a().createElement(W.SchemaField,{schema:null==u?void 0:u[S]}))),a().createElement("div",{className:g.optionList},m.length?m.map(((e,t)=>a().createElement("div",{className:g.optionItem,key:t,onClick:()=>{return p(t=e),v.setValues(t,"overwrite"),void c(!0);var t}},e[o]))):a().createElement("div",{className:g.emptyItem},"无数据")),a().createElement(y.A,{className:g.addIcon,onClick:()=>{p(null),v.reset(),c(!0)}}))}},8409:(e,t,o)=>{o.d(t,{v:()=>W});var n=o(7091),a=o(8769),r=o.n(a),l=o(2591),i=o.n(l),p=o(1740),s=o.n(p),c=o(8128),m=o.n(c),d=o(855),u=o.n(d),v=o(3051),b=o.n(v),f=o(3656),h=o.n(f),x=o(244),g={};g.styleTagTransform=h(),g.setAttributes=u(),g.insert=m().bind(null,"head"),g.domAPI=s(),g.insertStyleElement=b(),i()(x.A,g);const y=x.A&&x.A.locals?x.A.locals:void 0;var E=o(3373),C=o.n(E);const A=(0,a.createContext)({}),k=()=>{const e=(0,n.Mt)(),t=(0,n.X0)(),o=[];return t.mapProperties(((t,n)=>{var a;const r=e.query(e.address.concat(n)).take();if("none"!==(null==r?void 0:r.display)&&"hidden"!==(null==r?void 0:r.display)&&(null===(a=t["x-component"])||void 0===a?void 0:a.indexOf("CustomTab.TabPanel"))>-1){var l,i;const e=(null==r||null===(l=r.componentProps)||void 0===l?void 0:l.key)||(null==t||null===(i=t["x-component-props"])||void 0===i?void 0:i.key)||n;o.push({name:n,props:{...null==t?void 0:t["x-component-props"],...null==r?void 0:r.componentProps,key:e},schema:t})}})),o};function W(e){var t;const o=k(),[n,l]=(0,a.useState)(null===(t=o[0])||void 0===t?void 0:t.name);return r().createElement(A.Provider,{value:{activeTab:n}},r().createElement("div",{className:y.customTabWrapper},r().createElement("div",{className:y.customTabList},o.map((e=>{var t,o;return r().createElement("div",{className:C()(y.customTabItem,{[y.active]:n===(null===(t=e.props)||void 0===t?void 0:t.key)}),key:null===(o=e.props)||void 0===o?void 0:o.key,onClick:()=>l(e.props.key)},r().createElement("div",{className:y.customTabItemLabel},e.props.title))}))),e.children))}W.TabPanel=function(e){const{activeTab:t}=(0,a.useContext)(A);return(0,a.useMemo)((()=>e.tab===t),[t,e.tab])?r().createElement("div",{className:y.customTabPanel},e.children):null}},2513:(e,t,o)=>{o.d(t,{r:()=>l});var n=o(8769),a=o.n(n);const r=(0,o(1389).wrapBrick)("eo-icon-select",{onChange:"change"});function l(e){return a().createElement(r,e)}},966:(e,t,o)=>{o.d(t,{U:()=>i});var n=o(9575),a=o(8769),r=o.n(a),l=o(9708);function i(e){const[t,o]=(0,a.useState)(),i=(0,a.useCallback)((t=>{e.onChange(t?`${t}${e.suffix}`:void 0)}),[e]);return(0,a.useEffect)((()=>{const t=(e.value??"").replace(e.suffix,"");o(t)}),[e.suffix,e.value]),r().createElement(l.pd,(0,n.A)({},e,{value:t,onChange:e=>i(e.target.value)}))}},1477:(e,t,o)=>{o.d(t,{r:()=>c});var n=o(9575),a=o(8769),r=o.n(a),l=o(9708),i=o(7091),p=o(5908),s=o(2080);function c(e){const[t,o]=(0,a.useState)(!0),c=(0,i.mN)(),m=(0,i.Mt)(),{url:d,href:u}=e.transform??{url:"url",href:"href"},v=(0,a.useMemo)((()=>(0,p.fA)(s.ADVANCED_CHANGE_KEY,((e,t)=>o=>{o(e,t)}))),[]),b=(0,a.useCallback)((()=>{const n=!t;o(n),c.setValues({[n?d:u]:e.value}),c.deleteValuesIn(n?u:d)}),[t,c,d,e.value,u]),f=(0,a.useCallback)((o=>{e.onChange(o),c.setValues({[t?d:u]:o})}),[e,c,t,d,u]),h=(0,a.useMemo)((()=>t?"内链":"外链"),[t]),x=(0,a.useCallback)((e=>{const{values:t}=e.getState(),n=m.props.name;e.setValuesIn(n,t[d]??t[u]),o(!t[u])}),[m.props.name,u,d]);return(0,a.useEffect)((()=>{c.addEffects("onAdvancedChange",(()=>{(0,p.oJ)(x),v(((e,t)=>{const o=m.props.name;e&&t.deleteValuesIn(o)}))}))}),[c,m,v,x]),(0,a.useEffect)((()=>{x(c)}),[]),r().createElement(l.pd,(0,n.A)({},e,{suffix:r().createElement("div",{style:{cursor:"pointer"},slot:"suffix",onClick:b},h),onChange:e=>f(e.target.value)}))}},4287:(e,t,o)=>{o.d(t,{p:()=>c});var n=o(9575),a=o(8769),r=o.n(a),l=o(5524),i=o(1979),p=o(6394),s=o(4514);function c(e){return r().createElement(l.Ay.Group,(0,n.A)({},e,{size:"small"}),r().createElement(l.Ay.Button,{value:"left"},r().createElement(i.A,null)),!e.hideCenter&&r().createElement(l.Ay.Button,{value:"center"},r().createElement(p.A,null)),r().createElement(l.Ay.Button,{value:"right"},r().createElement(s.A,null)))}},5768:(e,t,o)=>{o.d(t,{_:()=>A});var n=o(8769),a=o.n(n),r=o(9708),l=o(4808),i=o(1469),p=o(2591),s=o.n(p),c=o(1740),m=o.n(c),d=o(8128),u=o.n(d),v=o(855),b=o.n(v),f=o(3051),h=o.n(f),x=o(3656),g=o.n(x),y=o(767),E={};E.styleTagTransform=g(),E.setAttributes=b(),E.insert=u().bind(null,"head"),E.domAPI=m(),E.insertStyleElement=h(),s()(y.A,E);const C=y.A&&y.A.locals?y.A.locals:void 0;function A(e){return a().createElement("div",{className:C.useChildrenSelectWrapper},a().createElement(r.l6,e),a().createElement(l.A,{title:"点击添加子节点"},a().createElement(i.A,{className:C.plusIcon,onClick:()=>{var t;null==e||null===(t=e.triggerAction)||void 0===t||t.call(e,"add-slot")}})))}},3995:(e,t,o)=>{o.d(t,{qZ:()=>l,N4:()=>r,cV:()=>p});var n=o(1030);const a={type:"void",name:"style",children:[{name:"width",title:"宽度",type:"string",decorator:{name:"FormItemWithoutAdvanced",props:{layout:"vertail"}},component:{name:"InputWithUnit",props:{suffix:"px"}}},{name:"height",title:"高度",type:"string",decorator:{name:"FormItemWithoutAdvanced",props:{layout:"vertail"}},component:{name:"InputWithUnit",props:{suffix:"px"}}},{type:"string",name:"textAlign",title:"对齐",decorator:{name:"FormItemWithoutAdvanced",props:{layout:"vertail"}},component:"TextAlignRadio"},{type:"string",name:"background",title:"背景",decorator:{name:"FormItemWithoutAdvanced",props:{layout:"vertail"}},component:"ColorPicker"},{type:"string",name:"margin",title:"外边距(px)",decorator:{name:"FormItemWithoutAdvanced"},component:"BoxSize"},{type:"string",name:"padding",title:"内边距(px)",decorator:{name:"FormItemWithoutAdvanced"},component:{name:"BoxSize",props:{mode:"in"}}}]},r="#normal_form",l="#advanced_form";function i(e,t){return e?"string"==typeof e?{[`x-${t}`]:e}:{[`x-${t}`]:e.name,[`x-${t}-props`]:{..."CodeEditor"===e.name?{extraLibs:"{{extraLibs}}",links:"{{links}}",tokenClick:"{{tokenClick}}",lineNumbers:"off",glyphMargin:!1}:{},...e.props??{}}}:{}}function p(e,t){const{isDefault:o=!0}="object"==typeof t?t:{},p=e=>{let t,o={};e.children&&(t=e.children.map(p));const{name:a,type:r,component:l,decorator:s}=e,c="string"===r?{name:"FormItem"}:"boolean"===r?{name:"FormItem",props:{layout:"horizontal"}}:{},m="string"===r?{name:"Input"}:"boolean"===r?{name:"Switch",props:{size:"small"}}:{},d={type:r??"void",...(0,n.omit)(e,["children","component","decorator"]),...i({...c,..."string"==typeof s?{name:s}:s},"decorator"),...i({...m,..."string"==typeof l?{name:l}:l},"component")};if("string"==typeof a?o[a]=d:o=d,t){d.properties={};for(const e of t)"string"==typeof e.name?d.properties[e.name]=e:d.properties={...d.properties,...e}}return o};return o?{type:"object",properties:{[r]:{type:"void","x-component":"CustomTab","x-component-props":{activeTab:"property"},properties:{property:{type:"void","x-component":"CustomTab.TabPanel","x-component-props":{title:"属性",tab:"property"},properties:p({...e,children:[{name:"id",title:"id",type:"string",decorator:{name:"FormItem",props:{layout:"horizontal"}}},{name:"hidden",title:"隐藏",type:"boolean"},...e.children]})},style:{type:"object",name:"style","x-component":"CustomTab.TabPanel","x-component-props":{title:"样式",tab:"style"},properties:p(a)}}},[l]:{name:l,type:"string","x-decorator":"FormItemWithoutAdvanced","x-component":"CodeEditor","x-component-props":{extraLibs:"{{extraLibs}}",links:"{{links}}",tokenClick:"{{tokenClick}}",minLines:5,glyphMargin:!1}}}}:p(e)}},6265:(e,t,o)=>{o.d(t,{A:()=>i});var n=o(6758),a=o.n(n),r=o(935),l=o.n(r)()(a());l.push([e.id,'.advanced-form-item{position:relative}.advanced-form-item .advanced-mode-check-wrapper{position:absolute;top:6px;right:6px;line-height:0;z-index:1}.advanced-form-item .advanced-mode-check-wrapper eo-icon[icon="code"]{cursor:pointer;padding:2px 4px;background:var(--palette-gray-7);border-radius:6px}.advanced-form-item .advanced-mode-check-wrapper eo-icon.isActive[icon="code"]{background:var(--color-brand);color:#fff}',""]);const i=l},7621:(e,t,o)=>{o.d(t,{A:()=>i});var n=o(6758),a=o.n(n),r=o(935),l=o.n(r)()(a());l.push([e.id,".custom-category-title{font-size:14px;font-weight:600;line-height:14px;margin-bottom:12px;border-left:2px solid;padding-left:6px;border-color:#8d8d8d;margin-top:18px}.custom-category-title:first-child{margin-top:0}",""]);const i=l},3276:(e,t,o)=>{o.d(t,{A:()=>c});var n=o(6758),a=o.n(n),r=o(935),l=o.n(r),i=o(6265),p=o(7621),s=l()(a());s.i(i.A),s.i(p.A),s.push([e.id,".property-form-wrapper .antdV5-formily-item-feedback-layout-loose{margin-bottom:10px}.property-form-wrapper .antdV5-formily-item .antdV5-formily-item-control{align-self:center}",""]);const c=s},3607:(e,t,o)=>{o.d(t,{A:()=>i});var n=o(6758),a=o.n(n),r=o(935),l=o.n(r)()(a());l.push([e.id,".boxSizeComponent--a96YEG0R{display:flex;gap:8px}.boxSizeComponent--a96YEG0R .leftWrapper--YJoTo4he{width:80px}.boxSizeComponent--a96YEG0R .leftWrapper--YJoTo4he .outBox--bSstM0ZF{border:1px solid var(--palette-gray-6);height:80px;padding:10px;border-radius:6px;position:relative}.boxSizeComponent--a96YEG0R .leftWrapper--YJoTo4he .outBox--bSstM0ZF .inBox--VAdQyQ8u{border:1px dashed var(--palette-gray-5);height:100%;border-radius:6px;display:flex;align-items:center;justify-content:center}.boxSizeComponent--a96YEG0R .leftWrapper--YJoTo4he .outBox--bSstM0ZF .inBox--VAdQyQ8u .connect-btn--iG4M5iHm{cursor:pointer}.boxSizeComponent--a96YEG0R .leftWrapper--YJoTo4he .outBox--bSstM0ZF .line--MEU6xbQI{position:absolute;background-color:var(--palette-gray-6)}.boxSizeComponent--a96YEG0R .leftWrapper--YJoTo4he .outBox--bSstM0ZF .line--MEU6xbQI.active--kwDvPu6c{background-color:var(--color-brand)}.boxSizeComponent--a96YEG0R .leftWrapper--YJoTo4he .outBox--bSstM0ZF .vertical--PTCuTBBU{left:50%;width:2px;height:10px}.boxSizeComponent--a96YEG0R .leftWrapper--YJoTo4he .outBox--bSstM0ZF .horizontal--C56jlFEU{top:50%;width:10px;height:2px}.boxSizeComponent--a96YEG0R .leftWrapper--YJoTo4he .outBox--bSstM0ZF .top--IAYy5_q3{top:0}.boxSizeComponent--a96YEG0R .leftWrapper--YJoTo4he .outBox--bSstM0ZF .right--lywbhIOD{right:0}.boxSizeComponent--a96YEG0R .leftWrapper--YJoTo4he .outBox--bSstM0ZF .bottom--bcHIN61S{bottom:0}.boxSizeComponent--a96YEG0R .leftWrapper--YJoTo4he .outBox--bSstM0ZF .left--ZqcFMgN_{left:0}.boxSizeComponent--a96YEG0R .rightWrapper--VEyni1eJ{flex:1;display:flex;flex-direction:column;gap:12px}.boxSizeComponent--a96YEG0R .rightWrapper--VEyni1eJ .inputWrapper--dlSjkwzs{display:flex;gap:12px}.boxSizeComponent--a96YEG0R .rightWrapper--VEyni1eJ .inputWrapper--dlSjkwzs .antdV5-input{text-align:right}",""]),l.locals={boxSizeComponent:"boxSizeComponent--a96YEG0R",leftWrapper:"leftWrapper--YJoTo4he",outBox:"outBox--bSstM0ZF",inBox:"inBox--VAdQyQ8u","connect-btn":"connect-btn--iG4M5iHm",line:"line--MEU6xbQI",active:"active--kwDvPu6c",vertical:"vertical--PTCuTBBU",horizontal:"horizontal--C56jlFEU",top:"top--IAYy5_q3",right:"right--lywbhIOD",bottom:"bottom--bcHIN61S",left:"left--ZqcFMgN_",rightWrapper:"rightWrapper--VEyni1eJ",inputWrapper:"inputWrapper--dlSjkwzs"};const i=l},244:(e,t,o)=>{o.d(t,{A:()=>i});var n=o(6758),a=o.n(n),r=o(935),l=o.n(r)()(a());l.push([e.id,".customTabWrapper--rhCkGBJ2 .customTabList--yAojeBWG{position:relative;display:flex;align-items:stretch;justify-items:flex-start;margin-bottom:8px}.customTabWrapper--rhCkGBJ2 .customTabList--yAojeBWG .customTabItem--Zjxji9O5{position:relative;text-align:center;cursor:pointer;transition:all 0.2s cubic-bezier(0.645,0.045,0.355,1);border-radius:4px;transform:translateZ(0)}.customTabWrapper--rhCkGBJ2 .customTabList--yAojeBWG .customTabItem--Zjxji9O5.active--ULNnDJEv{background-color:var(--palette-gray-6);box-shadow:0 1px 2px 0 rgba(0,0,0,0.03),0 1px 6px -1px rgba(0,0,0,0.02),0 2px 4px 0 rgba(0,0,0,0.02);color:#fff}.customTabWrapper--rhCkGBJ2 .customTabList--yAojeBWG .customTabItem--Zjxji9O5 .customTabItemLabel--scejdE0w{padding:2px 12px}",""]),l.locals={customTabWrapper:"customTabWrapper--rhCkGBJ2",customTabList:"customTabList--yAojeBWG",customTabItem:"customTabItem--Zjxji9O5",active:"active--ULNnDJEv",customTabItemLabel:"customTabItemLabel--scejdE0w"};const i=l},803:(e,t,o)=>{o.d(t,{A:()=>i});var n=o(6758),a=o.n(n),r=o(935),l=o.n(r)()(a());l.push([e.id,".actionOptionsWrapper--HuwosiuP .optionList--lJm6W8Kr .emptyItem--gMv4r0f7,\n .actionOptionsWrapper--HuwosiuP .optionList--lJm6W8Kr .optionItem--xEPQt9Mw{border:1px solid var(--palette-gray-6);display:flex;justify-content:center;align-items:center;font-size:14px;border-top:none}.actionOptionsWrapper--HuwosiuP .optionList--lJm6W8Kr .emptyItem--gMv4r0f7:first-child, .actionOptionsWrapper--HuwosiuP .optionList--lJm6W8Kr .optionItem--xEPQt9Mw:first-child{border-top:1px solid var(--palette-gray-6)}.actionOptionsWrapper--HuwosiuP .optionList--lJm6W8Kr .emptyItem--gMv4r0f7:last-child, .actionOptionsWrapper--HuwosiuP .optionList--lJm6W8Kr .optionItem--xEPQt9Mw:last-child{border-bottom:none}.actionOptionsWrapper--HuwosiuP .optionList--lJm6W8Kr .optionItem--xEPQt9Mw{cursor:pointer}.actionOptionsWrapper--HuwosiuP .optionList--lJm6W8Kr .optionItem--xEPQt9Mw:hover{background-color:var(--palette-gray-5)}.actionOptionsWrapper--HuwosiuP .addIcon--ptNA7JRE{width:100%;border:1px solid var(--palette-gray-6);display:flex;justify-content:center;align-items:center;padding:4px;font-size:22px}.modalFooter--eRxlWgTL{display:flex;justify-content:space-between}",""]),l.locals={actionOptionsWrapper:"actionOptionsWrapper--HuwosiuP",optionList:"optionList--lJm6W8Kr",emptyItem:"emptyItem--gMv4r0f7",optionItem:"optionItem--xEPQt9Mw",addIcon:"addIcon--ptNA7JRE",modalFooter:"modalFooter--eRxlWgTL"};const i=l},767:(e,t,o)=>{o.d(t,{A:()=>i});var n=o(6758),a=o.n(n),r=o(935),l=o.n(r)()(a());l.push([e.id,".useChildrenSelectWrapper--IczULak5{display:flex;gap:12px}.useChildrenSelectWrapper--IczULak5 .plusIcon--CyQgp1bl{cursor:pointer;font-size:22px;color:var(--color-brand)}",""]),l.locals={useChildrenSelectWrapper:"useChildrenSelectWrapper--IczULak5",plusIcon:"plusIcon--CyQgp1bl"};const i=l},74:(e,t,o)=>{var n=o(2591),a=o.n(n),r=o(1740),l=o.n(r),i=o(8128),p=o.n(i),s=o(855),c=o.n(s),m=o(3051),d=o.n(m),u=o(3656),v=o.n(u),b=o(3276),f={};f.styleTagTransform=v(),f.setAttributes=c(),f.insert=p().bind(null,"head"),f.domAPI=l(),f.insertStyleElement=d(),a()(b.A,f),b.A&&b.A.locals&&b.A.locals}}]);
|
|
2
|
+
//# sourceMappingURL=9080.8ae16d3a.js.map
|