@next-bricks/visual-builder 1.33.6 → 1.33.8
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 +5 -5
- package/dist/chunks/{114.c25646f6.js → 114.fdfd0dd9.js} +2 -2
- package/dist/chunks/{114.c25646f6.js.map → 114.fdfd0dd9.js.map} +1 -1
- package/dist/chunks/2252.25422902.js +3 -0
- package/dist/chunks/2252.25422902.js.map +1 -0
- package/dist/chunks/{2980.4cc0f343.js → 2980.0e831600.js} +2 -2
- package/dist/chunks/{2980.4cc0f343.js.map → 2980.0e831600.js.map} +1 -1
- package/dist/chunks/{3171.78801e88.js → 3171.fb82432a.js} +2 -2
- package/dist/chunks/{3171.78801e88.js.map → 3171.fb82432a.js.map} +1 -1
- package/dist/chunks/3933.67a1dc9c.js +2 -0
- package/dist/chunks/{3933.661888e2.js.map → 3933.67a1dc9c.js.map} +1 -1
- package/dist/chunks/{4837.d6d3ee9e.js → 4837.cd50030b.js} +2 -2
- package/dist/chunks/{4837.d6d3ee9e.js.map → 4837.cd50030b.js.map} +1 -1
- package/dist/chunks/{5552.069f3ddb.js → 5552.07444449.js} +2 -2
- package/dist/chunks/{5552.069f3ddb.js.map → 5552.07444449.js.map} +1 -1
- package/dist/chunks/{5814.eb38f464.js → 5814.8ed8f39d.js} +3 -3
- package/dist/chunks/{5814.eb38f464.js.map → 5814.8ed8f39d.js.map} +1 -1
- package/dist/chunks/6314.fb0eb5d4.js +2 -0
- package/dist/chunks/{6314.2b8fa035.js.map → 6314.fb0eb5d4.js.map} +1 -1
- package/dist/chunks/7150.0e64cf9e.js +3 -0
- package/dist/chunks/{7150.4d8eda87.js.map → 7150.0e64cf9e.js.map} +1 -1
- package/dist/chunks/{7218.c98c7ce3.js → 7218.9e675e7d.js} +2 -2
- package/dist/chunks/{7218.c98c7ce3.js.map → 7218.9e675e7d.js.map} +1 -1
- package/dist/chunks/7426.4f61da8a.js +3 -0
- package/dist/chunks/7426.4f61da8a.js.map +1 -0
- package/dist/chunks/{7733.4fc7b710.js → 7733.dfa9b454.js} +2 -2
- package/dist/chunks/{7733.4fc7b710.js.map → 7733.dfa9b454.js.map} +1 -1
- package/dist/chunks/{790.7771a19d.js → 790.733521cc.js} +2 -2
- package/dist/chunks/{790.7771a19d.js.map → 790.733521cc.js.map} +1 -1
- package/dist/chunks/9027.58391f17.js +2 -0
- package/dist/chunks/{9027.04c9b690.js.map → 9027.58391f17.js.map} +1 -1
- package/dist/chunks/{chat-preview.1f47cd1b.js → chat-preview.bb6cd3b4.js} +3 -3
- package/dist/chunks/{chat-preview.1f47cd1b.js.map → chat-preview.bb6cd3b4.js.map} +1 -1
- package/dist/chunks/check-editor-by-name.2c85abd3.js +2 -0
- package/dist/chunks/{check-editor-by-name.a14a198d.js.map → check-editor-by-name.2c85abd3.js.map} +1 -1
- package/dist/chunks/{contract-select.3e4f994a.js → contract-select.5302ec7e.js} +3 -3
- package/dist/chunks/{contract-select.3e4f994a.js.map → contract-select.5302ec7e.js.map} +1 -1
- package/dist/chunks/generate-snippets-context-menu.63e8786f.js +2 -0
- package/dist/chunks/{generate-snippets-context-menu.61a7ebf6.js.map → generate-snippets-context-menu.63e8786f.js.map} +1 -1
- package/dist/chunks/get-data-deps.d278d3ae.js +2 -0
- package/dist/chunks/{get-data-deps.a0530f8f.js.map → get-data-deps.d278d3ae.js.map} +1 -1
- package/dist/chunks/get-dependency-tree.1441e3c8.js +2 -0
- package/dist/chunks/{get-dependency-tree.ef3c0721.js.map → get-dependency-tree.1441e3c8.js.map} +1 -1
- package/dist/chunks/{inject-chat-preview-agent.0ac2fdfe.js → inject-chat-preview-agent.73e5e6da.js} +2 -2
- package/dist/chunks/{inject-chat-preview-agent.0ac2fdfe.js.map → inject-chat-preview-agent.73e5e6da.js.map} +1 -1
- package/dist/chunks/inject-preview-agent.b12c08c4.js +2 -0
- package/dist/chunks/{inject-preview-agent.4e9f6d84.js.map → inject-preview-agent.b12c08c4.js.map} +1 -1
- package/dist/chunks/main.07bd0560.js +2 -0
- package/dist/chunks/main.07bd0560.js.map +1 -0
- package/dist/chunks/parse-path.e260969b.js +2 -0
- package/dist/chunks/{parse-path.14a688cd.js.map → parse-path.e260969b.js.map} +1 -1
- package/dist/chunks/{pre-generated-container.d06024ab.js → pre-generated-container.182db37b.js} +2 -2
- package/dist/chunks/{pre-generated-container.d06024ab.js.map → pre-generated-container.182db37b.js.map} +1 -1
- package/dist/chunks/{pre-generated-preview.2993025c.js → pre-generated-preview.9fe5a3d8.js} +3 -3
- package/dist/chunks/{pre-generated-preview.2993025c.js.map → pre-generated-preview.9fe5a3d8.js.map} +1 -1
- package/dist/chunks/{property-editor.57302589.js → property-editor.6f5b4896.js} +2 -2
- package/dist/chunks/{property-editor.57302589.js.map → property-editor.6f5b4896.js.map} +1 -1
- package/dist/chunks/{workbench-action-list.eafcad31.js → workbench-action-list.a319ba8f.js} +2 -2
- package/dist/chunks/{workbench-action-list.eafcad31.js.map → workbench-action-list.a319ba8f.js.map} +1 -1
- package/dist/chunks/{workbench-history-action.f31e6bda.js → workbench-history-action.e20b5e26.js} +3 -3
- package/dist/chunks/{workbench-history-action.f31e6bda.js.map → workbench-history-action.e20b5e26.js.map} +1 -1
- package/dist/index.b98e786d.js +2 -0
- package/dist/index.b98e786d.js.map +1 -0
- package/dist/manifest.json +32 -32
- package/dist/types.json +79 -79
- package/package.json +3 -3
- package/dist/chunks/2252.cc6071dd.js +0 -3
- package/dist/chunks/2252.cc6071dd.js.map +0 -1
- package/dist/chunks/3933.661888e2.js +0 -2
- package/dist/chunks/6314.2b8fa035.js +0 -2
- package/dist/chunks/7150.4d8eda87.js +0 -3
- package/dist/chunks/7426.70d95964.js +0 -3
- package/dist/chunks/7426.70d95964.js.map +0 -1
- package/dist/chunks/9027.04c9b690.js +0 -2
- package/dist/chunks/check-editor-by-name.a14a198d.js +0 -2
- package/dist/chunks/generate-snippets-context-menu.61a7ebf6.js +0 -2
- package/dist/chunks/get-data-deps.a0530f8f.js +0 -2
- package/dist/chunks/get-dependency-tree.ef3c0721.js +0 -2
- package/dist/chunks/inject-preview-agent.4e9f6d84.js +0 -2
- package/dist/chunks/main.6e0f9e0a.js +0 -2
- package/dist/chunks/main.6e0f9e0a.js.map +0 -1
- package/dist/chunks/parse-path.14a688cd.js +0 -2
- package/dist/index.e97e1f75.js +0 -2
- package/dist/index.e97e1f75.js.map +0 -1
- /package/dist/chunks/{2252.cc6071dd.js.LICENSE.txt → 2252.25422902.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{5814.eb38f464.js.LICENSE.txt → 5814.8ed8f39d.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{7150.4d8eda87.js.LICENSE.txt → 7150.0e64cf9e.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{7426.70d95964.js.LICENSE.txt → 7426.4f61da8a.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{chat-preview.1f47cd1b.js.LICENSE.txt → chat-preview.bb6cd3b4.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{contract-select.3e4f994a.js.LICENSE.txt → contract-select.5302ec7e.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{pre-generated-preview.2993025c.js.LICENSE.txt → pre-generated-preview.9fe5a3d8.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{workbench-history-action.f31e6bda.js.LICENSE.txt → workbench-history-action.e20b5e26.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([[7733,114],{5873:(e,t,n)=>{var r=n(
|
|
2
|
-
//# sourceMappingURL=7733.
|
|
1
|
+
"use strict";(globalThis.webpackChunk_next_bricks_visual_builder=globalThis.webpackChunk_next_bricks_visual_builder||[]).push([[7733,114],{5873:(e,t,n)=>{var r=n(1816);t.H=r.createRoot,r.hydrateRoot},2559:(e,t,n)=>{function r(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}n.d(t,{A:()=>r})},2016:(e,t,n)=>{function r(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}n.d(t,{A:()=>r})},829:(e,t,n)=>{n.d(t,{A:()=>s});var r=n(2559);function s(e,t){return e.get((0,r.A)(e,t))}},918:(e,t,n)=>{n.d(t,{A:()=>s});var r=n(2016);function s(e,t,n){(0,r.A)(e,t),t.set(e,n)}},6121:(e,t,n)=>{n.d(t,{A:()=>s});var r=n(2559);function s(e,t,n){return e.set((0,r.A)(e,t),n),n}},4635:(e,t,n)=>{n.d(t,{A:()=>s});var r=n(2016);function s(e,t){(0,r.A)(e,t),t.add(e)}},9575:(e,t,n)=>{function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},r.apply(this,arguments)}n.d(t,{A:()=>r})},114:(e,t,n)=>{n.r(t),n.d(t,{ReactNextElement:()=>p,wrapBrick:()=>y,wrapLocalBrick:()=>v});var r=n(4635),s=n(918),i=n(2559),o=n(6121),a=n(829),c=n(8769),l=n(5873),h=n(1816),u=n(4782),d=new WeakMap,f=new WeakSet;class p extends u.NextElement{constructor(){super(...arguments),(0,r.A)(this,f),(0,s.A)(this,d,void 0)}connectedCallback(){super._markConnectedCallbackCalled(),(0,i.A)(f,this,A).call(this),this._render()}disconnectedCallback(){var e;null===(e=(0,a.A)(d,this))||void 0===e||e.render(null)}_render(){const e=()=>{if(!this.isConnected||!(0,a.A)(d,this))return;const e=this.constructor;var t;e.shadowOptions?(0,a.A)(d,this).render((0,u.supportsAdoptingStyleSheets)()||null===(t=e.styleTexts)||void 0===t||!t.length?this.render():c.createElement(c.Fragment,null,c.createElement("style",null,e.styleTexts.join("\n")),this.render())):(0,a.A)(d,this).render(this.render())};window.BRICK_NEXT_VERSIONS&&!window.DISABLE_REACT_FLUSH_SYNC?(0,h.flushSync)(e):e()}}function A(){if((0,a.A)(d,this))return;const e=this.constructor;if(e.shadowOptions){const n=this.attachShadow(e.shadowOptions);var t;if((0,u.supportsAdoptingStyleSheets)()&&null!==(t=e.styleTexts)&&void 0!==t&&t.length){const t=new CSSStyleSheet;t.replaceSync(e.styleTexts.join("")),n.adoptedStyleSheets=[t]}(0,o.A)(d,this,(0,l.H)(n))}else(0,o.A)(d,this,(0,l.H)(this))}var w=n(9575);function v(e,t){return(0,c.forwardRef)((function(n,r){let{children:s,...i}=n;const o="string"==typeof e?e:e.__tagName,a=b(i,t);return c.createElement(o,(0,w.A)({},a,{ref:r}),s)}))}function y(e,t){return(0,c.forwardRef)((function(n,r){let{children:s,...i}=n;const o=b(i,t);return c.createElement(e,(0,w.A)({},o,{ref:r}),s)}))}function b(e,t){let n;if(t){n={};for(const[r,s]of Object.entries(e))Object.prototype.hasOwnProperty.call(t,r)?n[`on${t[r]}`]=s:n[r]=s}else n=e;return n}}}]);
|
|
2
|
+
//# sourceMappingURL=7733.dfa9b454.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunks/7733.4fc7b710.js","mappings":"8JAEIA,EAAI,EAAQ,MAEdC,EAAQ,EAAaD,EAAEE,WACDF,EAAEG,W,iBCLX,SAASC,EAAkBC,EAAGC,EAAGC,GAC9C,GAAI,mBAAqBF,EAAIA,IAAMC,EAAID,EAAEG,IAAIF,GAAI,OAAOG,UAAUC,OAAS,EAAIJ,EAAIC,EACnF,MAAM,IAAII,UAAU,gDACtB,C,iCCHe,SAASC,EAA2BC,EAAKC,GACtD,GAAIA,EAAkBN,IAAIK,GACxB,MAAM,IAAIF,UAAU,iEAExB,C,+DCHe,SAASI,EAAuBC,EAAGC,GAChD,OAAOD,EAAEE,KAAI,OAAiBF,EAAGC,GACnC,C,+CCFe,SAASE,EAA2BN,EAAKO,EAAYC,IAClE,OAA0BR,EAAKO,GAC/BA,EAAWE,IAAIT,EAAKQ,EACtB,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Aea,GACtDL,EAAW,KAAKR,EAAca,MAAeC,EAE7CN,EAAWK,GAAYC,CAG7B,MACEN,EAAaH,EAEf,OAAOG,CACT,C","sources":["webpack:///../../node_modules/react-dom/client.js","webpack:///../../node_modules/@babel/runtime/helpers/esm/assertClassBrand.js","webpack:///../../node_modules/@babel/runtime/helpers/esm/checkPrivateRedeclaration.js","webpack:///../../node_modules/@babel/runtime/helpers/esm/classPrivateFieldGet2.js","webpack:///../../node_modules/@babel/runtime/helpers/esm/classPrivateFieldInitSpec.js","webpack:///../../node_modules/@babel/runtime/helpers/esm/classPrivateFieldSet2.js","webpack:///../../node_modules/@babel/runtime/helpers/esm/classPrivateMethodInitSpec.js","webpack:///../../node_modules/@babel/runtime/helpers/esm/extends.js","webpack:///../../node_modules/@next-core/react-element/dist/esm/ReactNextElement.js","webpack:///../../node_modules/@next-core/react-element/dist/esm/wrapBrick.js"],"sourcesContent":["'use strict';\n\nvar m = require('react-dom');\nif (process.env.NODE_ENV === 'production') {\n exports.createRoot = m.createRoot;\n exports.hydrateRoot = m.hydrateRoot;\n} else {\n var i = m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n exports.createRoot = function(c, o) {\n i.usingClientEntryPoint = true;\n try {\n return m.createRoot(c, o);\n } finally {\n i.usingClientEntryPoint = false;\n }\n };\n exports.hydrateRoot = function(c, h, o) {\n i.usingClientEntryPoint = true;\n try {\n return m.hydrateRoot(c, h, o);\n } finally {\n i.usingClientEntryPoint = false;\n }\n };\n}\n","export default function _assertClassBrand(e, t, n) {\n if (\"function\" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n;\n throw new TypeError(\"Private element is not present on this object\");\n}","export default function _checkPrivateRedeclaration(obj, privateCollection) {\n if (privateCollection.has(obj)) {\n throw new TypeError(\"Cannot initialize the same private elements twice on an object\");\n }\n}","import assertClassBrand from \"./assertClassBrand.js\";\nexport default function _classPrivateFieldGet2(s, a) {\n return s.get(assertClassBrand(s, a));\n}","import checkPrivateRedeclaration from \"./checkPrivateRedeclaration.js\";\nexport default function _classPrivateFieldInitSpec(obj, privateMap, value) {\n checkPrivateRedeclaration(obj, privateMap);\n privateMap.set(obj, value);\n}","import assertClassBrand from \"./assertClassBrand.js\";\nexport default function _classPrivateFieldSet2(s, a, r) {\n return s.set(assertClassBrand(s, a), r), r;\n}","import checkPrivateRedeclaration from \"./checkPrivateRedeclaration.js\";\nexport default function _classPrivateMethodInitSpec(obj, privateSet) {\n checkPrivateRedeclaration(obj, privateSet);\n privateSet.add(obj);\n}","export default function _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}","import _classPrivateMethodInitSpec from \"@babel/runtime/helpers/classPrivateMethodInitSpec\";\nimport _classPrivateFieldInitSpec from \"@babel/runtime/helpers/classPrivateFieldInitSpec\";\nimport _assertClassBrand from \"@babel/runtime/helpers/assertClassBrand\";\nimport _classPrivateFieldSet from \"@babel/runtime/helpers/classPrivateFieldSet2\";\nimport _classPrivateFieldGet from \"@babel/runtime/helpers/classPrivateFieldGet2\";\nvar _ReactNextElement;\nimport React from \"react\";\nimport { createRoot } from \"react-dom/client\";\nimport { flushSync } from \"react-dom\";\nimport { NextElement, supportsAdoptingStyleSheets } from \"@next-core/element\";\nvar _root = /*#__PURE__*/new WeakMap();\nvar _ReactNextElement_brand = /*#__PURE__*/new WeakSet();\nexport class ReactNextElement extends NextElement {\n constructor() {\n super(...arguments);\n _classPrivateMethodInitSpec(this, _ReactNextElement_brand);\n _classPrivateFieldInitSpec(this, _root, void 0);\n }\n connectedCallback() {\n super._markConnectedCallbackCalled();\n _assertClassBrand(_ReactNextElement_brand, this, _createRoot).call(this);\n this._render();\n }\n disconnectedCallback() {\n var _classPrivateFieldGet2;\n (_classPrivateFieldGet2 = _classPrivateFieldGet(_root, this)) === null || _classPrivateFieldGet2 === void 0 || _classPrivateFieldGet2.render(null);\n }\n _render() {\n const render = () => {\n if (!this.isConnected || !_classPrivateFieldGet(_root, this)) {\n return;\n }\n const ctor = this.constructor;\n if (ctor.shadowOptions) {\n var _ctor$styleTexts;\n _classPrivateFieldGet(_root, this).render(supportsAdoptingStyleSheets() || !((_ctor$styleTexts = ctor.styleTexts) !== null && _ctor$styleTexts !== void 0 && _ctor$styleTexts.length) ? this.render() : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(\"style\", null, ctor.styleTexts.join(\"\\n\")), this.render()));\n } else {\n _classPrivateFieldGet(_root, this).render(this.render());\n }\n };\n\n // In brick next container, enable flush sync for the initial mount of\n // each page, in order to avoid menu flickering.\n // Otherwise, avoid using flush sync as possible.\n if (window.BRICK_NEXT_VERSIONS && !window.DISABLE_REACT_FLUSH_SYNC) {\n flushSync(render);\n } else {\n render();\n }\n }\n}\n_ReactNextElement = ReactNextElement;\nfunction _createRoot() {\n if (_classPrivateFieldGet(_root, this)) {\n return;\n }\n const ctor = this.constructor;\n if (ctor.shadowOptions) {\n const shadowRoot = this.attachShadow(ctor.shadowOptions);\n if (supportsAdoptingStyleSheets()) {\n var _ctor$styleTexts2;\n if ((_ctor$styleTexts2 = ctor.styleTexts) !== null && _ctor$styleTexts2 !== void 0 && _ctor$styleTexts2.length) {\n const styleSheet = new CSSStyleSheet();\n styleSheet.replaceSync(ctor.styleTexts.join(\"\"));\n shadowRoot.adoptedStyleSheets = [styleSheet];\n }\n }\n _classPrivateFieldSet(_root, this, createRoot(shadowRoot));\n } else {\n var _ctor$styleTexts3;\n if (process.env.NODE_ENV !== \"production\" && (_ctor$styleTexts3 = ctor.styleTexts) !== null && _ctor$styleTexts3 !== void 0 && _ctor$styleTexts3.length) {\n throw new Error(\"Use `styleTexts` with `shadowOptions: false` is not supported\");\n }\n _classPrivateFieldSet(_root, this, createRoot(this));\n }\n}\n//# sourceMappingURL=ReactNextElement.js.map","import _extends from \"@babel/runtime/helpers/extends\";\nimport React, { forwardRef } from \"react\";\nexport function wrapLocalBrick(brick, eventsMapping) {\n // istanbul ignore next\n if (process.env.NODE_ENV === \"development\") {\n if (typeof brick === \"string\" && !customElements.get(brick)) {\n throw new Error(`Brick ${brick} is not defined while using \\`wrapLocalBrick\\`.`);\n }\n }\n return /*#__PURE__*/forwardRef(function BrickReactWrapper(_ref, ref) {\n let {\n children,\n ...props\n } = _ref;\n const WebComponent = typeof brick === \"string\" ? brick : brick.__tagName;\n const properties = getMappedProperties(props, eventsMapping);\n return /*#__PURE__*/React.createElement(WebComponent, _extends({}, properties, {\n ref: ref\n }), children);\n });\n}\nexport function wrapBrick(BrickName, eventsMapping) {\n return /*#__PURE__*/forwardRef(function BrickReactWrapper(_ref2, ref) {\n let {\n children,\n ...props\n } = _ref2;\n const properties = getMappedProperties(props, eventsMapping);\n return /*#__PURE__*/React.createElement(BrickName, _extends({}, properties, {\n ref: ref\n }), children);\n });\n}\nfunction getMappedProperties(props, eventsMapping) {\n let properties;\n if (eventsMapping) {\n properties = {};\n for (const [propName, propValue] of Object.entries(props)) {\n if (Object.prototype.hasOwnProperty.call(eventsMapping, propName)) {\n properties[`on${eventsMapping[propName]}`] = propValue;\n } else {\n properties[propName] = propValue;\n }\n }\n } else {\n properties = props;\n }\n return properties;\n}\n//# sourceMappingURL=wrapBrick.js.map"],"names":["m","exports","createRoot","hydrateRoot","_assertClassBrand","e","t","n","has","arguments","length","TypeError","_checkPrivateRedeclaration","obj","privateCollection","_classPrivateFieldGet2","s","a","get","_classPrivateFieldInitSpec","privateMap","value","set","_classPrivateFieldSet2","r","_classPrivateMethodInitSpec","privateSet","add","_extends","Object","assign","bind","target","i","source","key","prototype","hasOwnProperty","call","apply","this","_root","WeakMap","_ReactNextElement_brand","WeakSet","ReactNextElement","NextElement","constructor","super","connectedCallback","_markConnectedCallbackCalled","_createRoot","_render","disconnectedCallback","render","isConnected","ctor","_ctor$styleTexts","shadowOptions","supportsAdoptingStyleSheets","styleTexts","join","window","BRICK_NEXT_VERSIONS","DISABLE_REACT_FLUSH_SYNC","flushSync","shadowRoot","attachShadow","_ctor$styleTexts2","styleSheet","CSSStyleSheet","replaceSync","adoptedStyleSheets","wrapLocalBrick","brick","eventsMapping","forwardRef","_ref","ref","children","props","WebComponent","__tagName","properties","getMappedProperties","wrapBrick","BrickName","_ref2","propName","propValue","entries"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"chunks/7733.dfa9b454.js","mappings":"8JAEIA,EAAI,EAAQ,MAEdC,EAAQ,EAAaD,EAAEE,WACDF,EAAEG,W,iBCLX,SAASC,EAAkBC,EAAGC,EAAGC,GAC9C,GAAI,mBAAqBF,EAAIA,IAAMC,EAAID,EAAEG,IAAIF,GAAI,OAAOG,UAAUC,OAAS,EAAIJ,EAAIC,EACnF,MAAM,IAAII,UAAU,gDACtB,C,iCCHe,SAASC,EAA2BC,EAAKC,GACtD,GAAIA,EAAkBN,IAAIK,GACxB,MAAM,IAAIF,UAAU,iEAExB,C,+DCHe,SAASI,EAAuBC,EAAGC,GAChD,OAAOD,EAAEE,KAAI,OAAiBF,EAAGC,GACnC,C,+CCFe,SAASE,EAA2BN,EAAKO,EAAYC,IAClE,OAA0BR,EAAKO,GAC/BA,EAAWE,IAAIT,EAAKQ,EACtB,C,gDCHe,SAASE,EAAuBP,EAAGC,EAAGO,GACnD,OAAOR,EAAEM,KAAI,OAAiBN,EAAGC,GAAIO,GAAIA,CAC3C,C,gDCFe,SAASC,EAA4BZ,EAAKa,IACvD,OAA0Bb,EAAKa,GAC/BA,EAAWC,IAAId,EACjB,C,iBCJe,SAASe,IAYtB,OAXAA,EAAWC,OAAOC,OAASD,OAAOC,OAAOC,OAAS,SAAUC,GAC1D,IAAK,IAAIC,EAAI,EAAGA,EAAIxB,UAAUC,OAAQuB,IAAK,CACzC,IAAIC,EAASzB,UAAUwB,GACvB,IAAK,IAAIE,KAAOD,EACVL,OAAOO,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ACvBD,EAAWE,YAAYf,EAAKI,WAAWC,KAAK,KAC5CK,EAAWM,mBAAqB,CAACH,EACnC,EAEF,OAAsB5B,EAAOD,MAAM,OAAW0B,GAChD,MAKE,OAAsBzB,EAAOD,MAAM,OAAWA,MAElD,C,cCzEO,SAASiC,EAAeC,EAAOC,GAOpC,OAAoB,IAAAC,aAAW,SAA2BC,EAAMC,GAC9D,IAAI,SACFC,KACGC,GACDH,EACJ,MAAMI,EAAgC,iBAAVP,EAAqBA,EAAQA,EAAMQ,UACzDC,EAAaC,EAAoBJ,EAAOL,GAC9C,OAAoB,gBAAoBM,GAAc,OAAS,CAAC,EAAGE,EAAY,CAC7EL,IAAKA,IACHC,EACN,GACF,CACO,SAASM,EAAUC,EAAWX,GACnC,OAAoB,IAAAC,aAAW,SAA2BW,EAAOT,GAC/D,IAAI,SACFC,KACGC,GACDO,EACJ,MAAMJ,EAAaC,EAAoBJ,EAAOL,GAC9C,OAAoB,gBAAoBW,GAAW,OAAS,CAAC,EAAGH,EAAY,CAC1EL,IAAKA,IACHC,EACN,GACF,CACA,SAASK,EAAoBJ,EAAOL,GAClC,IAAIQ,EACJ,GAAIR,EAAe,CACjBQ,EAAa,CAAC,EACd,IAAK,MAAOK,EAAUC,KAAc5D,OAAO6D,QAAQV,GAC7CnD,OAAOO,UAAUC,eAAeC,KAAKqC,EAAea,GACtDL,EAAW,KAAKR,EAAca,MAAeC,EAE7CN,EAAWK,GAAYC,CAG7B,MACEN,EAAaH,EAEf,OAAOG,CACT,C","sources":["webpack:///../../node_modules/react-dom/client.js","webpack:///../../node_modules/@babel/runtime/helpers/esm/assertClassBrand.js","webpack:///../../node_modules/@babel/runtime/helpers/esm/checkPrivateRedeclaration.js","webpack:///../../node_modules/@babel/runtime/helpers/esm/classPrivateFieldGet2.js","webpack:///../../node_modules/@babel/runtime/helpers/esm/classPrivateFieldInitSpec.js","webpack:///../../node_modules/@babel/runtime/helpers/esm/classPrivateFieldSet2.js","webpack:///../../node_modules/@babel/runtime/helpers/esm/classPrivateMethodInitSpec.js","webpack:///../../node_modules/@babel/runtime/helpers/esm/extends.js","webpack:///../../node_modules/@next-core/react-element/dist/esm/ReactNextElement.js","webpack:///../../node_modules/@next-core/react-element/dist/esm/wrapBrick.js"],"sourcesContent":["'use strict';\n\nvar m = require('react-dom');\nif (process.env.NODE_ENV === 'production') {\n exports.createRoot = m.createRoot;\n exports.hydrateRoot = m.hydrateRoot;\n} else {\n var i = m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n exports.createRoot = function(c, o) {\n i.usingClientEntryPoint = true;\n try {\n return m.createRoot(c, o);\n } finally {\n i.usingClientEntryPoint = false;\n }\n };\n exports.hydrateRoot = function(c, h, o) {\n i.usingClientEntryPoint = true;\n try {\n return m.hydrateRoot(c, h, o);\n } finally {\n i.usingClientEntryPoint = false;\n }\n };\n}\n","export default function _assertClassBrand(e, t, n) {\n if (\"function\" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n;\n throw new TypeError(\"Private element is not present on this object\");\n}","export default function _checkPrivateRedeclaration(obj, privateCollection) {\n if (privateCollection.has(obj)) {\n throw new TypeError(\"Cannot initialize the same private elements twice on an object\");\n }\n}","import assertClassBrand from \"./assertClassBrand.js\";\nexport default function _classPrivateFieldGet2(s, a) {\n return s.get(assertClassBrand(s, a));\n}","import checkPrivateRedeclaration from \"./checkPrivateRedeclaration.js\";\nexport default function _classPrivateFieldInitSpec(obj, privateMap, value) {\n checkPrivateRedeclaration(obj, privateMap);\n privateMap.set(obj, value);\n}","import assertClassBrand from \"./assertClassBrand.js\";\nexport default function _classPrivateFieldSet2(s, a, r) {\n return s.set(assertClassBrand(s, a), r), r;\n}","import checkPrivateRedeclaration from \"./checkPrivateRedeclaration.js\";\nexport default function _classPrivateMethodInitSpec(obj, privateSet) {\n checkPrivateRedeclaration(obj, privateSet);\n privateSet.add(obj);\n}","export default function _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}","import _classPrivateMethodInitSpec from \"@babel/runtime/helpers/classPrivateMethodInitSpec\";\nimport _classPrivateFieldInitSpec from \"@babel/runtime/helpers/classPrivateFieldInitSpec\";\nimport _assertClassBrand from \"@babel/runtime/helpers/assertClassBrand\";\nimport _classPrivateFieldSet from \"@babel/runtime/helpers/classPrivateFieldSet2\";\nimport _classPrivateFieldGet from \"@babel/runtime/helpers/classPrivateFieldGet2\";\nvar _ReactNextElement;\nimport React from \"react\";\nimport { createRoot } from \"react-dom/client\";\nimport { flushSync } from \"react-dom\";\nimport { NextElement, supportsAdoptingStyleSheets } from \"@next-core/element\";\nvar _root = /*#__PURE__*/new WeakMap();\nvar _ReactNextElement_brand = /*#__PURE__*/new WeakSet();\nexport class ReactNextElement extends NextElement {\n constructor() {\n super(...arguments);\n _classPrivateMethodInitSpec(this, _ReactNextElement_brand);\n _classPrivateFieldInitSpec(this, _root, void 0);\n }\n connectedCallback() {\n super._markConnectedCallbackCalled();\n _assertClassBrand(_ReactNextElement_brand, this, _createRoot).call(this);\n this._render();\n }\n disconnectedCallback() {\n var _classPrivateFieldGet2;\n (_classPrivateFieldGet2 = _classPrivateFieldGet(_root, this)) === null || _classPrivateFieldGet2 === void 0 || _classPrivateFieldGet2.render(null);\n }\n _render() {\n const render = () => {\n if (!this.isConnected || !_classPrivateFieldGet(_root, this)) {\n return;\n }\n const ctor = this.constructor;\n if (ctor.shadowOptions) {\n var _ctor$styleTexts;\n _classPrivateFieldGet(_root, this).render(supportsAdoptingStyleSheets() || !((_ctor$styleTexts = ctor.styleTexts) !== null && _ctor$styleTexts !== void 0 && _ctor$styleTexts.length) ? this.render() : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(\"style\", null, ctor.styleTexts.join(\"\\n\")), this.render()));\n } else {\n _classPrivateFieldGet(_root, this).render(this.render());\n }\n };\n\n // In brick next container, enable flush sync for the initial mount of\n // each page, in order to avoid menu flickering.\n // Otherwise, avoid using flush sync as possible.\n if (window.BRICK_NEXT_VERSIONS && !window.DISABLE_REACT_FLUSH_SYNC) {\n flushSync(render);\n } else {\n render();\n }\n }\n}\n_ReactNextElement = ReactNextElement;\nfunction _createRoot() {\n if (_classPrivateFieldGet(_root, this)) {\n return;\n }\n const ctor = this.constructor;\n if (ctor.shadowOptions) {\n const shadowRoot = this.attachShadow(ctor.shadowOptions);\n if (supportsAdoptingStyleSheets()) {\n var _ctor$styleTexts2;\n if ((_ctor$styleTexts2 = ctor.styleTexts) !== null && _ctor$styleTexts2 !== void 0 && _ctor$styleTexts2.length) {\n const styleSheet = new CSSStyleSheet();\n styleSheet.replaceSync(ctor.styleTexts.join(\"\"));\n shadowRoot.adoptedStyleSheets = [styleSheet];\n }\n }\n _classPrivateFieldSet(_root, this, createRoot(shadowRoot));\n } else {\n var _ctor$styleTexts3;\n if (process.env.NODE_ENV !== \"production\" && (_ctor$styleTexts3 = ctor.styleTexts) !== null && _ctor$styleTexts3 !== void 0 && _ctor$styleTexts3.length) {\n throw new Error(\"Use `styleTexts` with `shadowOptions: false` is not supported\");\n }\n _classPrivateFieldSet(_root, this, createRoot(this));\n }\n}\n//# sourceMappingURL=ReactNextElement.js.map","import _extends from \"@babel/runtime/helpers/extends\";\nimport React, { forwardRef } from \"react\";\nexport function wrapLocalBrick(brick, eventsMapping) {\n // istanbul ignore next\n if (process.env.NODE_ENV === \"development\") {\n if (typeof brick === \"string\" && !customElements.get(brick)) {\n throw new Error(`Brick ${brick} is not defined while using \\`wrapLocalBrick\\`.`);\n }\n }\n return /*#__PURE__*/forwardRef(function BrickReactWrapper(_ref, ref) {\n let {\n children,\n ...props\n } = _ref;\n const WebComponent = typeof brick === \"string\" ? brick : brick.__tagName;\n const properties = getMappedProperties(props, eventsMapping);\n return /*#__PURE__*/React.createElement(WebComponent, _extends({}, properties, {\n ref: ref\n }), children);\n });\n}\nexport function wrapBrick(BrickName, eventsMapping) {\n return /*#__PURE__*/forwardRef(function BrickReactWrapper(_ref2, ref) {\n let {\n children,\n ...props\n } = _ref2;\n const properties = getMappedProperties(props, eventsMapping);\n return /*#__PURE__*/React.createElement(BrickName, _extends({}, properties, {\n ref: ref\n }), children);\n });\n}\nfunction getMappedProperties(props, eventsMapping) {\n let properties;\n if (eventsMapping) {\n properties = {};\n for (const [propName, propValue] of Object.entries(props)) {\n if (Object.prototype.hasOwnProperty.call(eventsMapping, propName)) {\n properties[`on${eventsMapping[propName]}`] = propValue;\n } else {\n properties[propName] = propValue;\n }\n }\n } else {\n properties = props;\n }\n return properties;\n}\n//# sourceMappingURL=wrapBrick.js.map"],"names":["m","exports","createRoot","hydrateRoot","_assertClassBrand","e","t","n","has","arguments","length","TypeError","_checkPrivateRedeclaration","obj","privateCollection","_classPrivateFieldGet2","s","a","get","_classPrivateFieldInitSpec","privateMap","value","set","_classPrivateFieldSet2","r","_classPrivateMethodInitSpec","privateSet","add","_extends","Object","assign","bind","target","i","source","key","prototype","hasOwnProperty","call","apply","this","_root","WeakMap","_ReactNextElement_brand","WeakSet","ReactNextElement","NextElement","constructor","super","connectedCallback","_markConnectedCallbackCalled","_createRoot","_render","disconnectedCallback","render","isConnected","ctor","_ctor$styleTexts","shadowOptions","supportsAdoptingStyleSheets","styleTexts","join","window","BRICK_NEXT_VERSIONS","DISABLE_REACT_FLUSH_SYNC","flushSync","shadowRoot","attachShadow","_ctor$styleTexts2","styleSheet","CSSStyleSheet","replaceSync","adoptedStyleSheets","wrapLocalBrick","brick","eventsMapping","forwardRef","_ref","ref","children","props","WebComponent","__tagName","properties","getMappedProperties","wrapBrick","BrickName","_ref2","propName","propValue","entries"],"sourceRoot":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";(globalThis.webpackChunk_next_bricks_visual_builder=globalThis.webpackChunk_next_bricks_visual_builder||[]).push([[790,5552,3171],{5552:(e,n,t)=>{t.r(n),t.d(n,{i18n:()=>p,i18nText:()=>l,initializeI18n:()=>o});var i=t(2350),s=t(8799),r=t(7072);let u=!1;const a=new Set;function o(e,n){if(u||(u=!0,s.i18n.use(r.default).init({fallbackLng:"zh",debug:!1,supportedLngs:["zh","en"],nonExplicitSupportedLngs:!0,interpolation:{escapeValue:!1},react:{useSuspense:!1},compatibilityJSON:"v3",resources:{}})),e&&n&&!a.has(e)){a.add(e);for(const[t,i]of Object.entries(n))s.i18n.addResourceBundle(t,e,i)}}var c=t(
|
|
2
|
-
//# sourceMappingURL=790.
|
|
1
|
+
"use strict";(globalThis.webpackChunk_next_bricks_visual_builder=globalThis.webpackChunk_next_bricks_visual_builder||[]).push([[790,5552,3171],{5552:(e,n,t)=>{t.r(n),t.d(n,{i18n:()=>p,i18nText:()=>l,initializeI18n:()=>o});var i=t(2350),s=t(8799),r=t(7072);let u=!1;const a=new Set;function o(e,n){if(u||(u=!0,s.i18n.use(r.default).init({fallbackLng:"zh",debug:!1,supportedLngs:["zh","en"],nonExplicitSupportedLngs:!0,interpolation:{escapeValue:!1},react:{useSuspense:!1},compatibilityJSON:"v3",resources:{}})),e&&n&&!a.has(e)){a.add(e);for(const[t,i]of Object.entries(n))s.i18n.addResourceBundle(t,e,i)}}var c=t(279);function l(e){if(!e)return;const n=s.i18n.language??"zh-CN";if((0,c.hasOwnProperty)(e,n))return e[n];const t=n.split("-")[0];if(t!==n)return(0,c.hasOwnProperty)(e,t)?e[t]:void 0;const i=`${t}-`;for(const n of Object.keys(e))if(n.startsWith(i))return e[n]}const p=i.default}}]);
|
|
2
|
+
//# sourceMappingURL=790.733521cc.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunks/790.
|
|
1
|
+
{"version":3,"file":"chunks/790.733521cc.js","mappings":"gQAEA,IAAIA,GAAc,EAClB,MAAMC,EAAwB,IAAIC,IAC3B,SAASC,EAAeC,EAAIC,GAwBjC,GAvBKL,IACHA,GAAc,EACd,EAAAM,KAICC,IAAmF,WAEnFC,KAAK,CACJC,YAAa,KACbC,OAAO,EACPC,cAAe,CAAC,KAAM,MACtBC,0BAA0B,EAC1BC,cAAe,CACbC,aAAa,GAEfC,MAAO,CACLC,aAAa,GAEfC,kBAAmB,KACnBC,UAAW,CAAC,KAGXd,GAAOC,IAAWJ,EAAsBkB,IAAIf,GAAjD,CAGAH,EAAsBmB,IAAIhB,GAC1B,IAAK,MAAOiB,EAAMH,KAAcI,OAAOC,QAAQlB,GAC7C,EAAAC,KAAKkB,kBAAkBH,EAAMjB,EAAIc,EAHnC,CAKF,C,aCjCO,SAASO,EAASC,GACvB,IAAKA,EACH,OAEF,MAAMC,EAAW,EAAArB,KAAKqB,UAAY,QAElC,IAAI,IAAAC,gBAAeF,EAAMC,GACvB,OAAOD,EAAKC,GAGd,MAAME,EAAkBF,EAASG,MAAM,KAAK,GAC5C,GAAID,IAAoBF,EAGtB,OAAO,IAAAC,gBAAeF,EAAMG,GAAmBH,EAAKG,QAAmBE,EAKzE,MAAMC,EAAS,GAAGH,KAClB,IAAK,MAAMI,KAAOX,OAAOY,KAAKR,GAC5B,GAAIO,EAAIE,WAAWH,GACjB,OAAON,EAAKO,EAGlB,CC1BO,MAAM3B,EAA6E,S","sources":["webpack:///../../node_modules/@next-core/i18n/dist/esm/init.js","webpack:///../../node_modules/@next-core/i18n/dist/esm/text.js","webpack:///../../node_modules/@next-core/i18n/dist/esm/index.js"],"sourcesContent":["import { i18n } from \"@next-core/i18n\";\nimport LanguageDetector from \"i18next-browser-languagedetector\";\nlet initialized = false;\nconst initializedNamespaces = new Set();\nexport function initializeI18n(NS, locales) {\n if (!initialized) {\n initialized = true;\n i18n\n // learn more: https://github.com/i18next/i18next-xhr-backend\n // .use(Backend)\n // learn more: https://github.com/i18next/i18next-browser-languageDetector\n .use(process.env.NODE_ENV === \"test\" ? LanguageDetector : /* istanbul ignore next */LanguageDetector.default)\n // for all options read: https://www.i18next.com/overview/configuration-options\n .init({\n fallbackLng: \"zh\",\n debug: process.env.NODE_ENV === \"development\",\n supportedLngs: [\"zh\", \"en\"],\n nonExplicitSupportedLngs: true,\n interpolation: {\n escapeValue: false // not needed for react as it escapes by default\n },\n react: {\n useSuspense: false\n },\n compatibilityJSON: \"v3\",\n resources: {}\n });\n }\n if (!NS || !locales || initializedNamespaces.has(NS)) {\n return;\n }\n initializedNamespaces.add(NS);\n for (const [lang, resources] of Object.entries(locales)) {\n i18n.addResourceBundle(lang, NS, resources);\n }\n}\n//# sourceMappingURL=init.js.map","import { i18n } from \"@next-core/i18n\";\nimport { hasOwnProperty } from \"@next-core/utils/general\";\nexport function i18nText(data) {\n if (!data) {\n return;\n }\n const language = i18n.language ?? \"zh-CN\";\n // First, make a perfect match.\n if (hasOwnProperty(data, language)) {\n return data[language];\n }\n // https://en.wikipedia.org/wiki/IETF_language_tag\n const primaryLanguage = language.split(\"-\")[0];\n if (primaryLanguage !== language) {\n // Then, match the primary language (which omits other subtags).\n // E.g., match `zh` if the current language is `zh-CN`.\n return hasOwnProperty(data, primaryLanguage) ? data[primaryLanguage] : undefined;\n }\n // At last, match the first key which starts with the primary language,\n // if the current language contains primary subtag only.\n // E.g., match `zh-CN` if the current language is `zh`.\n const prefix = `${primaryLanguage}-`;\n for (const key of Object.keys(data)) {\n if (key.startsWith(prefix)) {\n return data[key];\n }\n }\n}\n//# sourceMappingURL=text.js.map","import i18next from \"i18next\";\nexport const i18n = process.env.NODE_ENV === \"test\" ? i18next : /* istanbul ignore next */i18next.default;\nexport * from \"./init.js\";\nexport * from \"./text.js\";\n//# sourceMappingURL=index.js.map"],"names":["initialized","initializedNamespaces","Set","initializeI18n","NS","locales","i18n","use","init","fallbackLng","debug","supportedLngs","nonExplicitSupportedLngs","interpolation","escapeValue","react","useSuspense","compatibilityJSON","resources","has","add","lang","Object","entries","addResourceBundle","i18nText","data","language","hasOwnProperty","primaryLanguage","split","undefined","prefix","key","keys","startsWith"],"sourceRoot":""}
|
|
@@ -0,0 +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(279),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(9435),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,x=n.__secret_internals,E=r.flowApi,k=!1;try{var L;const e=window.dll;if(e&&null!==(L=window.BRICK_NEXT_VERSIONS)&&void 0!==L&&null!==(L=L["brick-container"])&&void 0!==L&&L.startsWith("2.")){const{getHistory:t,developHelper:o,collectDebugContract:n}=e("tYg3"),{matchPath:a}=e("A+yw");S=t,I=a,x={...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})}},E={collectDebugContract:n},k=!0}}catch(e){console.error("Try to use v2 runtime APIs failed:",e)}let P=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,L;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 M=()=>{x.updateTemplatePreviewSettings(t.appId,t.templateId,N),S().reload()},R=()=>{x.updateSnippetPreviewSettings(t.appId,JSON.parse(t.snippetData)),S().reload()},q=()=>{x.updateFormPreviewSettings(t.appId,t.formId,t.formData),S().reload()},O=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,L=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 P;let e;var C,_;"route"===b.options.updateStoryboardType?x.updateStoryboardByRoute(t.appId,b.storyboardPatch):"template"===b.options.updateStoryboardType?x.updateStoryboardByTemplate(t.appId,b.storyboardPatch,b.options.settings):"snippet"===b.options.updateStoryboardType?x.updateStoryboardBySnippet(t.appId,b.storyboardPatch):"form"===b.options.updateStoryboardType&&x.updateFormPreviewSettings(t.appId,t.formId,b.storyboardPatch),"form"!==(null===(P=b.options)||void 0===P?void 0:P.updateStoryboardType)&&(e=await(null===(C=(_=x).getAddedContracts)||void 0===C?void 0:C.call(_,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}x.updateStoryboard(t.appId,b.storyboardPatch),t.templateId?(N=b.settings,M()):t.formId||t.formData?q():null!==(f=b.options)&&void 0!==f&&f.snippetData?(t.snippetData=b.options.snippetData,R()):S().reload();break;case"reload":location.reload();break;case"back":O.goBack();break;case"forward":O.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=x.getContextValue(e,{tplStateStoreId:n});else{r="inspect-all-data-values-success";const e=x.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&&E.collectDebugContract([o]);const a=await x.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);break;case"excute-proxy-method":{const[e,t,o=[]]=b.proxyMethodArgs;try{const n=document.body.querySelector(e)[t](...o);window.parent.postMessage({sender:"previewer",type:"excute-proxy-method-success",data:{method:t,res:n}})}catch(e){window.parent.postMessage({sender:"previewer",type:"excute-proxy-method-error",data:{method:t,res:e.message}})}break}}})),window.addEventListener("scroll",(()=>{s({type:"scroll",scroll:{x:window.scrollX,y:window.scrollY}})}));let _,H=!0;const V=e=>{s({type:"url-change",url:location.origin+O.createHref(e)}),_=e,B()};function B(){if(t.routePath){const e=!!I(_.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&&(M(),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&&(q(),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&&(R(),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!==P&&(null===(n=P)||void 0===n||n.removeEventListener("scroll",F),null==o||o.addEventListener("scroll",F),P=o,C=t)}function F(){s({type:"content-scroll",scroll:{x:this.scrollLeft,y:this.scrollTop}})}V(O.location),O.listen(V),t.templateId&&M(),(t.formId||t.formData)&&q(),t.snippetData&&R();const U=()=>{var e;const o=t.routeId,n=x.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=x).setRealTimeDataInspectRoot)||void 0===n||n.call(a,{tplStateStoreId:o}))}null===(o=(r=x).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,L)}),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?P.scrollLeft:0),top:s+window.scrollY+(n?P.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.58391f17.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunks/9027.04c9b690.js","mappings":"yMAgCO,SAASA,EAAqBC,GACnC,MAAMC,EArBR,SAAiBC,GAC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ApBD,EAAG1L,SAAiB,IAAA0L,OAAA,EAAjBA,EAAmBE,SAASjJ,IAC/C,MAAEmC,EAAK,OAAEE,EAAM,KAAE6G,EAAI,IAAEC,GAAQnJ,EAAQoJ,wBAC7C,MAAO,CACLjH,QACAE,SACA6G,KACEA,EACAlQ,OAAO4M,SACNoD,EAAmB5L,EAAqBkK,WAAa,GACxD6B,IACEA,EACAnQ,OAAO6M,SACNmD,EAAmB5L,EAAqBmK,UAAY,GACvDpJ,QACA6K,mBACD,GAEL,CA1DmBK,CADAC,EAAgC9O,EAAKqO,GACf1K,GACvC,OAAO0K,EACHzK,EAAS1B,KAAKzE,IAAI,IACbA,EACHoK,OAAQrJ,OAAOsJ,YAAcrK,EAAKkR,QAEpC/K,CACN,CAEO,SAASkL,EACd9O,EACAqO,GAEA,MAAMC,EAA0B,GAuBhC,OArBA,SAASS,EAAKC,GACZ,MAAMC,EAAaD,EAAKE,iBACtBb,EAASrO,EAAM,cAAcA,OAK/B,GAHAsO,EAAS3Q,QAAQsR,KAGbD,IAASvJ,UAAYwJ,EAAW1Q,OAAS,GAK7C,IAAK,MAAMd,KAAQuR,EAAKE,iBAAiB,KACnCzR,EAAKiP,YACPqC,EAAKtR,EAAKiP,WAGhB,CAEAqC,CAAKtJ,UAEE6I,CACT,CAuBA,SAAS/E,IAA6C,IAAA4F,EACpD,MAAMpD,EAAiBtG,SAASuF,cAAc,qBAE9C,OAAQe,SAA0B,QAAZoD,EAAdpD,EAAgBI,kBAAU,IAAAgD,OAAA,EAA3BA,EAA6CpP,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 as Error).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","ref","method","args","proxyMethodArgs","result","querySelector","res","err","scroll","scrollX","scrollY","currentLocation","previewPageMatch","sendLocationChange","loc","createHref","match","pathname","path","exact","mainMountPoint","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.58391f17.js","mappings":"wMAgCO,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,GACnBC,OAAOC,OAAOC,YACZ,CACEC,OAAQ,YACR1B,KAAM,eACNoB,WAEFN,EAGN,CA9FEa,CAAYX,EAAMY,eACpB,CAEA,SAASC,EAAab,GACpBA,EAAMC,iBACND,EAAME,iBACR,CAEA,MAAMY,GAAeC,EAAAA,EAAAA,WAClBZ,IACC,MAAMC,EAAUC,EAAwBF,GAEpCC,EAAQE,OAAS,GACnBC,OAAOC,OAAOC,YACZ,CACEC,OAAQ,YACR1B,KAAM,iBACNoB,WAEFN,EAEJ,GAEF,I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oD,EAAdpD,EAAgBI,kBAAU,IAAAgD,OAAA,EAA3BA,EAA6CpP,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 as Error).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","ref","method","args","proxyMethodArgs","result","querySelector","res","err","scroll","scrollX","scrollY","currentLocation","previewPageMatch","sendLocationChange","loc","createHref","match","pathname","path","exact","mainMountPoint","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,3 +1,3 @@
|
|
|
1
|
-
/*! For license information please see chat-preview.
|
|
2
|
-
(globalThis.webpackChunk_next_bricks_visual_builder=globalThis.webpackChunk_next_bricks_visual_builder||[]).push([[5402,2052],{9047:(e,t,n)=>{"use strict";n.d(t,{e:()=>o});var r=n(8769),i=n.n(r);function o(e){let{variant:t,width:n,height:r,left:o,top:a,label:s}=e;return i().createElement("div",{className:"outline "+t,style:{width:n+8,height:r+8,left:o-4,top:a-4}},i().createElement("div",{className:"label"},s))}},44:(e,t,n)=>{"use strict";n.r(t),n.d(t,{ChatPreview:()=>D,ChatPreviewComponent:()=>Y});var r,i=n(9575),o=n(4635),a=n(918),s=n(6902),c=n(5536),u=n(6121),l=n(829),p=n(2740),d=n(8769),h=n.n(d),f=n(4782),v=n(1389),g=(n(6477),n(9322)),b=n(1732),y=n(3373),m=n.n(y),w=n(9047),A=n(1563);let k,x,E,S,_,j,T,O,P,C,M,W,z,V,B,N;const{defineElement:R,property:I,event:L,method:$}=(0,f.createDecorators)();let D;var q=new WeakMap,H=new WeakMap,J=new WeakMap,U=new WeakMap,F=new WeakMap,G=new WeakMap,K=new WeakSet,Q=new WeakMap;class X extends v.ReactNextElement{constructor(){super(...arguments),(0,o.A)(this,K),(0,a.A)(this,q,(k(this),E(this))),(0,a.A)(this,H,(S(this),_(this))),(0,a.A)(this,J,(j(this),T(this))),(0,a.A)(this,U,(O(this),P(this))),(0,a.A)(this,F,(C(this),M(this))),(0,a.A)(this,G,(W(this),z(this))),(0,a.A)(this,Q,(N(this),e=>{(0,c.A)(K,this,V).emit(e)}))}get storyboard(){return(0,l.A)(q,this)}set storyboard(e){(0,u.A)(q,this,e)}get theme(){return(0,l.A)(H,this)}set theme(e){(0,u.A)(H,this,e)}get uiVersion(){return(0,l.A)(J,this)}set uiVersion(e){(0,u.A)(J,this,e)}get app(){return(0,l.A)(U,this)}set app(e){(0,u.A)(U,this,e)}get inspecting(){return(0,l.A)(F,this)}set inspecting(e){(0,u.A)(F,this,e)}select(e){var t;const n=null===(t=this.shadowRoot)||void 0===t||null===(t=t.querySelector("iframe"))||void 0===t?void 0:t.contentWindow;null==n||n.postMessage({channel:"chat-preview",type:"select",payload:e},location.origin)}render(){return h().createElement(Y,{storyboard:this.storyboard,theme:this.theme,uiVersion:this.uiVersion,app:this.app,inspecting:this.inspecting,onActiveTargetChange:(0,l.A)(Q,this)})}}function Y(e){let{storyboard:t,theme:n,uiVersion:r,app:o,inspecting:a,onActiveTargetChange:s}=e;const c=(0,d.useRef)(),[u,l]=(0,d.useState)(!1),[p,f]=(0,d.useState)(!1),[v,y]=(0,d.useState)({x:0,y:0}),[A,k]=(0,d.useState)([]),[x,E]=(0,d.useState)([]),[S,_]=(0,d.useState)([]),[j,T]=(0,d.useState)([]),O=(0,d.useCallback)((()=>{const e=()=>{var t;const n=null===(t=c.current)||void 0===t?void 0:t.contentWindow;null!=n&&n._preview_only_render?l(!0):setTimeout(e,100)};e()}),[]);(0,d.useEffect)((()=>{var e;if(!u)return;const t=g.__secret_internals.getBrickPackagesById("bricks/visual-builder");if(!t)throw new Error("Cannot find preview agent package: bricks/visual-builder");(null===(e=c.current)||void 0===e||null===(e=e.contentWindow)||void 0===e?void 0:e._preview_only_inject)("visual-builder.inject-chat-preview-agent",{...t,filePath:`${location.origin}${(0,g.getBasePath)()}${window.PUBLIC_ROOT??""}${t.filePath}`})}),[u]),(0,d.useEffect)((()=>{var e;if(!u)return;const i=null===(e=c.current)||void 0===e||null===(e=e.contentWindow)||void 0===e?void 0:e._preview_only_render;i&&i("yaml",{yaml:(0,b.safeDump)(t,{schema:b.JSON_SCHEMA,skipInvalid:!0,noRefs:!0,noCompatMode:!0})},{app:o,theme:n,uiVersion:r})}),[o,u,t,n,r]);const P=(0,d.useMemo)((()=>{if(p)return()=>{setTimeout((()=>{window.postMessage({channel:"chat-preview",type:"inspect-hover",payload:{outlines:[]}})}),100)}}),[p]);(0,d.useEffect)((()=>{const e=e=>{var t;if("chat-preview"===(null===(t=e.data)||void 0===t?void 0:t.channel))switch(e.data.type){case"initialized":f(!0);break;case"inspect-hover":k(e.data.payload.outlines);break;case"scroll":y(e.data.payload);break;case"inspect-active":E(e.data.payload.outlines)}};return window.addEventListener("message",e),()=>{window.removeEventListener("message",e)}}),[]),(0,d.useEffect)((()=>{var e;p&&(null===(e=c.current)||void 0===e||null===(e=e.contentWindow)||void 0===e||e.postMessage({channel:"chat-preview",type:"toggle-inspecting",payload:{inspecting:a}},location.origin))}),[p,a]);const C=(0,d.useCallback)((e=>e.map((e=>{var t,n;const r=(null==c||null===(t=c.current)||void 0===t?void 0:t.offsetLeft)??0,i=(null==c||null===(n=c.current)||void 0===n?void 0:n.offsetTop)??0,{width:o,height:a,left:s,top:u,...l}=e;return{width:1*o,height:1*a,left:1*(s-v.x)+r,top:1*(u-v.y)+i,...l}}))),[v.x,v.y]);return(0,d.useEffect)((()=>{s(x[0])}),[x,s]),(0,d.useEffect)((()=>{T(C(x))}),[x,C]),(0,d.useEffect)((()=>{_(C(A))}),[A,C]),h().createElement("div",{className:m()("container",{inspecting:a})},h().createElement("iframe",{ref:c,src:`${(0,g.getBasePath)()}_brick-preview-v3_/preview/`,loading:"lazy",onLoad:O,onMouseOut:P}),S.map(((e,t)=>h().createElement(w.e,(0,i.A)({key:t,variant:"hover"},e)))),j.map(((e,t)=>h().createElement(w.e,(0,i.A)({key:t,variant:"active"},e)))))}r=X,({e:[E,S,_,j,T,O,P,C,M,W,z,V,B,N,k],c:[D,x]}=(0,p.A)(r,[R("visual-builder.chat-preview",{styleTexts:[A.A]})],[[I({attribute:!1}),1,"storyboard"],[I(),1,"theme"],[I(),1,"uiVersion"],[I(),1,"app"],[I({type:Boolean}),1,"inspecting"],[L({type:"activeTarget.change"}),1,"activeTargetChangeEvent",e=>(0,l.A)(G,e),(e,t)=>(0,u.A)(G,e,t)],[$(),2,"select"]],0,(e=>Q.has((0,s.A)(e))),v.ReactNextElement)),x()},1563:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});var r=n(6758),i=n.n(r),o=n(935),a=n.n(o)()(i());a.push([e.id,":host{display:block}:host([hidden]){display:none}*{box-sizing:border-box}.container,\niframe{width:100%;height:100%;border-radius:4px}.container{position:relative;box-shadow:rgba(204,204,204,0.2) 0px 0px 0px 1px}iframe{display:block;border:none;margin:0;padding:0;transform-origin:0% 0%;-webkit-user-select:none;user-select:none}.outline{position:absolute;border-style:solid;border-width:2px;border-radius:0 4px 4px;pointer-events:none}.label{position:absolute;left:-2px;top:-20px;height:18px;line-height:16px;padding:2px 5px 0;font-size:12px;border-radius:4px 4px 0 0;white-space:nowrap}.outline.hover{border-color:rgba(var(--palette-blue-6-channel),0.3)}.outline.hover .label{background:rgba(var(--palette-blue-6-channel),0.3)}.outline.active{border-color:var(--palette-blue-6)}.outline.active .label{background:var(--palette-blue-6)}.container:not(.inspecting) .outline{display:none}",""]);const s=a.toString()},935:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,r,i,o){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(r)for(var s=0;s<this.length;s++){var c=this[s][0];null!=c&&(a[c]=!0)}for(var u=0;u<e.length;u++){var l=[].concat(e[u]);r&&a[l[0]]||(void 0!==o&&(void 0===l[5]||(l[1]="@layer".concat(l[5].length>0?" ".concat(l[5]):""," {").concat(l[1],"}")),l[5]=o),n&&(l[2]?(l[1]="@media ".concat(l[2]," {").concat(l[1],"}"),l[2]=n):l[2]=n),i&&(l[4]?(l[1]="@supports (".concat(l[4],") {").concat(l[1],"}"),l[4]=i):l[4]="".concat(i)),t.push(l))}},t}},6758:e=>{"use strict";e.exports=function(e){return e[1]}},3373:(e,t)=>{var n;!function(){"use strict";var r={}.hasOwnProperty;function i(){for(var e="",t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=a(e,o(n)))}return e}function o(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return i.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var n in e)r.call(e,n)&&e[n]&&(t=a(t,n));return t}function a(e,t){return t?e?e+" "+t:e+t:e}e.exports?(i.default=i,e.exports=i):void 0===(n=function(){return i}.apply(t,[]))||(e.exports=n)}()},2740:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});var r=n(7545),i=n(6902);function o(e,t,n){"symbol"==(0,r.A)(t)&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:n?n+" "+t:t})}catch(e){}return e}var a=n(1369);function s(e,t,n,s,c,u){var l,p,d,h,f,v,g,b=Symbol.metadata||Symbol.for("Symbol.metadata"),y=Object.defineProperty,m=Object.create,w=[m(null),m(null)],A=t.length;function k(t,n,r){return function(i,o){n&&(o=i,i=e);for(var a=0;a<t.length;a++)o=t[a].apply(i,r?[o]:[]);return r?o:i}}function x(e,t,n,r){if("function"!=typeof e&&(r||void 0!==e))throw new TypeError(t+" must "+(n||"be")+" a function"+(r?"":" or undefined"));return e}function E(e,t,n,i,a,s,c,u,d,h,f){function v(e){if(!f(e))throw new TypeError("Attempted to access private element on non-instance")}var g=[].concat(t[0]),b=t[3],m=!c,A=1===a,E=3===a,S=4===a,_=2===a;function j(t,n,r){return function(i,o){return n&&(o=i,i=e),r&&r(i),T[t].call(i,o)}}if(!m){var T={},O=[],P=E?"get":S||A?"set":"value";if(d?(h||A?T={get:o((function(){return b(this)}),i,"get"),set:function(e){t[4](this,e)}}:T[P]=b,h||o(T[P],i,_?"":P)):h||(T=Object.getOwnPropertyDescriptor(e,i)),!h&&!d){if((p=w[+u][i])&&7!=(p^a))throw Error("Decorating two elements with the same name ("+T[P].name+") is not supported yet");w[+u][i]=a<3?1:a}}for(var C=e,M=g.length-1;M>=0;M-=n?2:1){var W=x(g[M],"A decorator","be",!0),z=n?g[M-1]:void 0,V={},B={kind:["field","accessor","method","getter","setter","class"][a],name:i,metadata:l,addInitializer:function(e,t){if(e.v)throw Error("attempted to call addInitializer after decoration was finished");x(t,"An initializer","be",!0),s.push(t)}.bind(null,V)};if(m)p=W.call(z,C,B),V.v=1,x(p,"class decorators","return")&&(C=p);else if(B.static=u,B.private=d,p=B.access={has:d?f.bind():function(e){return i in e}},S||(p.get=d?_?function(e){return v(e),T.value}:j("get",0,v):function(e){return e[i]}),_||E||(p.set=d?j("set",0,v):function(e,t){e[i]=t}),C=W.call(z,A?{get:T.get,set:T.set}:T[P],B),V.v=1,A){if("object"==(0,r.A)(C)&&C)(p=x(C.get,"accessor.get"))&&(T.get=p),(p=x(C.set,"accessor.set"))&&(T.set=p),(p=x(C.init,"accessor.init"))&&O.unshift(p);else if(void 0!==C)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else x(C,(h?"field":"method")+" decorators","return")&&(h?O.unshift(C):T[P]=C)}return a<2&&c.push(k(O,u,1),k(s,u,0)),h||m||(d?A?c.splice(-1,0,j("get",u),j("set",u)):c.push(_?T[P]:x.call.bind(T[P])):y(e,i,T)),C}function S(e){return y(e,b,{configurable:!0,enumerable:!0,value:l})}return void 0!==u&&(l=u[b]),l=m(null==l?null:l),f=[],v=function(e){e&&f.push(k(e))},g=function(t,r){for(var o=0;o<n.length;o++){var s=n[o],u=s[1],l=7&u;if((8&u)==t&&!l==r){var p=s[2],v=!!s[3],g=16&u;E(t?e:e.prototype,s,g,v?"#"+p:(0,a.A)(p),l,l<2?[]:t?h=h||[]:d=d||[],f,!!t,v,r,t&&v?function(t){return(0,i.A)(t)===e}:c)}}},g(8,0),g(0,0),g(8,1),g(0,1),v(d),v(h),p=f,A||S(e),{e:p,get c(){var n=[];return A&&[S(e=E(e,[t],s,e.name,5,n)),k(n,1)]}}}},2559:(e,t,n)=>{"use strict";function r(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}n.d(t,{A:()=>r})},6902:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(7545);function i(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(null!==e?(0,r.A)(e):"null"));return e}},2016:(e,t,n)=>{"use strict";function r(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}n.d(t,{A:()=>r})},829:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(2559);function i(e,t){return e.get((0,r.A)(e,t))}},918:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(2016);function i(e,t,n){(0,r.A)(e,t),t.set(e,n)}},6121:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(2559);function i(e,t,n){return e.set((0,r.A)(e,t),n),n}},5536:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(2559);function i(e,t,n){return n((0,r.A)(e,t))}},4635:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(2016);function i(e,t){(0,r.A)(e,t),t.add(e)}},9575:(e,t,n)=>{"use strict";function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},r.apply(this,arguments)}n.d(t,{A:()=>r})},1369:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(7545);function i(e){var t=function(e,t){if("object"!=(0,r.A)(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,"string");if("object"!=(0,r.A)(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==(0,r.A)(t)?t:t+""}},7545:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n.d(t,{A:()=>r})}}]);
|
|
3
|
-
//# sourceMappingURL=chat-preview.
|
|
1
|
+
/*! For license information please see chat-preview.bb6cd3b4.js.LICENSE.txt */
|
|
2
|
+
(globalThis.webpackChunk_next_bricks_visual_builder=globalThis.webpackChunk_next_bricks_visual_builder||[]).push([[5402,2052],{9047:(e,t,n)=>{"use strict";n.d(t,{e:()=>o});var r=n(8769),i=n.n(r);function o(e){let{variant:t,width:n,height:r,left:o,top:a,label:s}=e;return i().createElement("div",{className:"outline "+t,style:{width:n+8,height:r+8,left:o-4,top:a-4}},i().createElement("div",{className:"label"},s))}},44:(e,t,n)=>{"use strict";n.r(t),n.d(t,{ChatPreview:()=>D,ChatPreviewComponent:()=>Y});var r,i=n(9575),o=n(4635),a=n(918),s=n(6902),c=n(5536),u=n(6121),l=n(829),p=n(2740),d=n(8769),h=n.n(d),f=n(4782),v=n(1389),g=(n(6477),n(9435)),b=n(1732),y=n(3373),m=n.n(y),w=n(9047),A=n(1563);let k,x,E,S,_,j,T,O,P,C,M,W,z,V,B,N;const{defineElement:R,property:I,event:L,method:$}=(0,f.createDecorators)();let D;var q=new WeakMap,H=new WeakMap,J=new WeakMap,U=new WeakMap,F=new WeakMap,G=new WeakMap,K=new WeakSet,Q=new WeakMap;class X extends v.ReactNextElement{constructor(){super(...arguments),(0,o.A)(this,K),(0,a.A)(this,q,(k(this),E(this))),(0,a.A)(this,H,(S(this),_(this))),(0,a.A)(this,J,(j(this),T(this))),(0,a.A)(this,U,(O(this),P(this))),(0,a.A)(this,F,(C(this),M(this))),(0,a.A)(this,G,(W(this),z(this))),(0,a.A)(this,Q,(N(this),e=>{(0,c.A)(K,this,V).emit(e)}))}get storyboard(){return(0,l.A)(q,this)}set storyboard(e){(0,u.A)(q,this,e)}get theme(){return(0,l.A)(H,this)}set theme(e){(0,u.A)(H,this,e)}get uiVersion(){return(0,l.A)(J,this)}set uiVersion(e){(0,u.A)(J,this,e)}get app(){return(0,l.A)(U,this)}set app(e){(0,u.A)(U,this,e)}get inspecting(){return(0,l.A)(F,this)}set inspecting(e){(0,u.A)(F,this,e)}select(e){var t;const n=null===(t=this.shadowRoot)||void 0===t||null===(t=t.querySelector("iframe"))||void 0===t?void 0:t.contentWindow;null==n||n.postMessage({channel:"chat-preview",type:"select",payload:e},location.origin)}render(){return h().createElement(Y,{storyboard:this.storyboard,theme:this.theme,uiVersion:this.uiVersion,app:this.app,inspecting:this.inspecting,onActiveTargetChange:(0,l.A)(Q,this)})}}function Y(e){let{storyboard:t,theme:n,uiVersion:r,app:o,inspecting:a,onActiveTargetChange:s}=e;const c=(0,d.useRef)(),[u,l]=(0,d.useState)(!1),[p,f]=(0,d.useState)(!1),[v,y]=(0,d.useState)({x:0,y:0}),[A,k]=(0,d.useState)([]),[x,E]=(0,d.useState)([]),[S,_]=(0,d.useState)([]),[j,T]=(0,d.useState)([]),O=(0,d.useCallback)((()=>{const e=()=>{var t;const n=null===(t=c.current)||void 0===t?void 0:t.contentWindow;null!=n&&n._preview_only_render?l(!0):setTimeout(e,100)};e()}),[]);(0,d.useEffect)((()=>{var e;if(!u)return;const t=g.__secret_internals.getBrickPackagesById("bricks/visual-builder");if(!t)throw new Error("Cannot find preview agent package: bricks/visual-builder");(null===(e=c.current)||void 0===e||null===(e=e.contentWindow)||void 0===e?void 0:e._preview_only_inject)("visual-builder.inject-chat-preview-agent",{...t,filePath:`${location.origin}${(0,g.getBasePath)()}${window.PUBLIC_ROOT??""}${t.filePath}`})}),[u]),(0,d.useEffect)((()=>{var e;if(!u)return;const i=null===(e=c.current)||void 0===e||null===(e=e.contentWindow)||void 0===e?void 0:e._preview_only_render;i&&i("yaml",{yaml:(0,b.safeDump)(t,{schema:b.JSON_SCHEMA,skipInvalid:!0,noRefs:!0,noCompatMode:!0})},{app:o,theme:n,uiVersion:r})}),[o,u,t,n,r]);const P=(0,d.useMemo)((()=>{if(p)return()=>{setTimeout((()=>{window.postMessage({channel:"chat-preview",type:"inspect-hover",payload:{outlines:[]}})}),100)}}),[p]);(0,d.useEffect)((()=>{const e=e=>{var t;if("chat-preview"===(null===(t=e.data)||void 0===t?void 0:t.channel))switch(e.data.type){case"initialized":f(!0);break;case"inspect-hover":k(e.data.payload.outlines);break;case"scroll":y(e.data.payload);break;case"inspect-active":E(e.data.payload.outlines)}};return window.addEventListener("message",e),()=>{window.removeEventListener("message",e)}}),[]),(0,d.useEffect)((()=>{var e;p&&(null===(e=c.current)||void 0===e||null===(e=e.contentWindow)||void 0===e||e.postMessage({channel:"chat-preview",type:"toggle-inspecting",payload:{inspecting:a}},location.origin))}),[p,a]);const C=(0,d.useCallback)((e=>e.map((e=>{var t,n;const r=(null==c||null===(t=c.current)||void 0===t?void 0:t.offsetLeft)??0,i=(null==c||null===(n=c.current)||void 0===n?void 0:n.offsetTop)??0,{width:o,height:a,left:s,top:u,...l}=e;return{width:1*o,height:1*a,left:1*(s-v.x)+r,top:1*(u-v.y)+i,...l}}))),[v.x,v.y]);return(0,d.useEffect)((()=>{s(x[0])}),[x,s]),(0,d.useEffect)((()=>{T(C(x))}),[x,C]),(0,d.useEffect)((()=>{_(C(A))}),[A,C]),h().createElement("div",{className:m()("container",{inspecting:a})},h().createElement("iframe",{ref:c,src:`${(0,g.getBasePath)()}_brick-preview-v3_/preview/`,loading:"lazy",onLoad:O,onMouseOut:P}),S.map(((e,t)=>h().createElement(w.e,(0,i.A)({key:t,variant:"hover"},e)))),j.map(((e,t)=>h().createElement(w.e,(0,i.A)({key:t,variant:"active"},e)))))}r=X,({e:[E,S,_,j,T,O,P,C,M,W,z,V,B,N,k],c:[D,x]}=(0,p.A)(r,[R("visual-builder.chat-preview",{styleTexts:[A.A]})],[[I({attribute:!1}),1,"storyboard"],[I(),1,"theme"],[I(),1,"uiVersion"],[I(),1,"app"],[I({type:Boolean}),1,"inspecting"],[L({type:"activeTarget.change"}),1,"activeTargetChangeEvent",e=>(0,l.A)(G,e),(e,t)=>(0,u.A)(G,e,t)],[$(),2,"select"]],0,(e=>Q.has((0,s.A)(e))),v.ReactNextElement)),x()},1563:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});var r=n(6758),i=n.n(r),o=n(935),a=n.n(o)()(i());a.push([e.id,":host{display:block}:host([hidden]){display:none}*{box-sizing:border-box}.container,\niframe{width:100%;height:100%;border-radius:4px}.container{position:relative;box-shadow:rgba(204,204,204,0.2) 0px 0px 0px 1px}iframe{display:block;border:none;margin:0;padding:0;transform-origin:0% 0%;-webkit-user-select:none;user-select:none}.outline{position:absolute;border-style:solid;border-width:2px;border-radius:0 4px 4px;pointer-events:none}.label{position:absolute;left:-2px;top:-20px;height:18px;line-height:16px;padding:2px 5px 0;font-size:12px;border-radius:4px 4px 0 0;white-space:nowrap}.outline.hover{border-color:rgba(var(--palette-blue-6-channel),0.3)}.outline.hover .label{background:rgba(var(--palette-blue-6-channel),0.3)}.outline.active{border-color:var(--palette-blue-6)}.outline.active .label{background:var(--palette-blue-6)}.container:not(.inspecting) .outline{display:none}",""]);const s=a.toString()},935:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,r,i,o){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(r)for(var s=0;s<this.length;s++){var c=this[s][0];null!=c&&(a[c]=!0)}for(var u=0;u<e.length;u++){var l=[].concat(e[u]);r&&a[l[0]]||(void 0!==o&&(void 0===l[5]||(l[1]="@layer".concat(l[5].length>0?" ".concat(l[5]):""," {").concat(l[1],"}")),l[5]=o),n&&(l[2]?(l[1]="@media ".concat(l[2]," {").concat(l[1],"}"),l[2]=n):l[2]=n),i&&(l[4]?(l[1]="@supports (".concat(l[4],") {").concat(l[1],"}"),l[4]=i):l[4]="".concat(i)),t.push(l))}},t}},6758:e=>{"use strict";e.exports=function(e){return e[1]}},3373:(e,t)=>{var n;!function(){"use strict";var r={}.hasOwnProperty;function i(){for(var e="",t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=a(e,o(n)))}return e}function o(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return i.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var n in e)r.call(e,n)&&e[n]&&(t=a(t,n));return t}function a(e,t){return t?e?e+" "+t:e+t:e}e.exports?(i.default=i,e.exports=i):void 0===(n=function(){return i}.apply(t,[]))||(e.exports=n)}()},2740:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});var r=n(7545),i=n(6902);function o(e,t,n){"symbol"==(0,r.A)(t)&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:n?n+" "+t:t})}catch(e){}return e}var a=n(1369);function s(e,t,n,s,c,u){var l,p,d,h,f,v,g,b=Symbol.metadata||Symbol.for("Symbol.metadata"),y=Object.defineProperty,m=Object.create,w=[m(null),m(null)],A=t.length;function k(t,n,r){return function(i,o){n&&(o=i,i=e);for(var a=0;a<t.length;a++)o=t[a].apply(i,r?[o]:[]);return r?o:i}}function x(e,t,n,r){if("function"!=typeof e&&(r||void 0!==e))throw new TypeError(t+" must "+(n||"be")+" a function"+(r?"":" or undefined"));return e}function E(e,t,n,i,a,s,c,u,d,h,f){function v(e){if(!f(e))throw new TypeError("Attempted to access private element on non-instance")}var g=[].concat(t[0]),b=t[3],m=!c,A=1===a,E=3===a,S=4===a,_=2===a;function j(t,n,r){return function(i,o){return n&&(o=i,i=e),r&&r(i),T[t].call(i,o)}}if(!m){var T={},O=[],P=E?"get":S||A?"set":"value";if(d?(h||A?T={get:o((function(){return b(this)}),i,"get"),set:function(e){t[4](this,e)}}:T[P]=b,h||o(T[P],i,_?"":P)):h||(T=Object.getOwnPropertyDescriptor(e,i)),!h&&!d){if((p=w[+u][i])&&7!=(p^a))throw Error("Decorating two elements with the same name ("+T[P].name+") is not supported yet");w[+u][i]=a<3?1:a}}for(var C=e,M=g.length-1;M>=0;M-=n?2:1){var W=x(g[M],"A decorator","be",!0),z=n?g[M-1]:void 0,V={},B={kind:["field","accessor","method","getter","setter","class"][a],name:i,metadata:l,addInitializer:function(e,t){if(e.v)throw Error("attempted to call addInitializer after decoration was finished");x(t,"An initializer","be",!0),s.push(t)}.bind(null,V)};if(m)p=W.call(z,C,B),V.v=1,x(p,"class decorators","return")&&(C=p);else if(B.static=u,B.private=d,p=B.access={has:d?f.bind():function(e){return i in e}},S||(p.get=d?_?function(e){return v(e),T.value}:j("get",0,v):function(e){return e[i]}),_||E||(p.set=d?j("set",0,v):function(e,t){e[i]=t}),C=W.call(z,A?{get:T.get,set:T.set}:T[P],B),V.v=1,A){if("object"==(0,r.A)(C)&&C)(p=x(C.get,"accessor.get"))&&(T.get=p),(p=x(C.set,"accessor.set"))&&(T.set=p),(p=x(C.init,"accessor.init"))&&O.unshift(p);else if(void 0!==C)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else x(C,(h?"field":"method")+" decorators","return")&&(h?O.unshift(C):T[P]=C)}return a<2&&c.push(k(O,u,1),k(s,u,0)),h||m||(d?A?c.splice(-1,0,j("get",u),j("set",u)):c.push(_?T[P]:x.call.bind(T[P])):y(e,i,T)),C}function S(e){return y(e,b,{configurable:!0,enumerable:!0,value:l})}return void 0!==u&&(l=u[b]),l=m(null==l?null:l),f=[],v=function(e){e&&f.push(k(e))},g=function(t,r){for(var o=0;o<n.length;o++){var s=n[o],u=s[1],l=7&u;if((8&u)==t&&!l==r){var p=s[2],v=!!s[3],g=16&u;E(t?e:e.prototype,s,g,v?"#"+p:(0,a.A)(p),l,l<2?[]:t?h=h||[]:d=d||[],f,!!t,v,r,t&&v?function(t){return(0,i.A)(t)===e}:c)}}},g(8,0),g(0,0),g(8,1),g(0,1),v(d),v(h),p=f,A||S(e),{e:p,get c(){var n=[];return A&&[S(e=E(e,[t],s,e.name,5,n)),k(n,1)]}}}},2559:(e,t,n)=>{"use strict";function r(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}n.d(t,{A:()=>r})},6902:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(7545);function i(e){if(Object(e)!==e)throw TypeError("right-hand side of 'in' should be an object, got "+(null!==e?(0,r.A)(e):"null"));return e}},2016:(e,t,n)=>{"use strict";function r(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}n.d(t,{A:()=>r})},829:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(2559);function i(e,t){return e.get((0,r.A)(e,t))}},918:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(2016);function i(e,t,n){(0,r.A)(e,t),t.set(e,n)}},6121:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(2559);function i(e,t,n){return e.set((0,r.A)(e,t),n),n}},5536:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(2559);function i(e,t,n){return n((0,r.A)(e,t))}},4635:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(2016);function i(e,t){(0,r.A)(e,t),t.add(e)}},9575:(e,t,n)=>{"use strict";function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},r.apply(this,arguments)}n.d(t,{A:()=>r})},1369:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(7545);function i(e){var t=function(e,t){if("object"!=(0,r.A)(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,"string");if("object"!=(0,r.A)(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==(0,r.A)(t)?t:t+""}},7545:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n.d(t,{A:()=>r})}}]);
|
|
3
|
+
//# sourceMappingURL=chat-preview.bb6cd3b4.js.map
|