UNPKG

@chief-editor/preview

Version:

FlowEditor Editor

1 lines 1.4 kB
"use strict";var __assign=this&&this.__assign||function(){return(__assign=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},__rest=this&&this.__rest||function(e,t){var r={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(r[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(a=Object.getOwnPropertySymbols(e);n<a.length;n++)t.indexOf(a[n])<0&&Object.prototype.propertyIsEnumerable.call(e,a[n])&&(r[a[n]]=e[a[n]])}return r},__importStar=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(exports,"__esModule",{value:!0});var runtime_1=require("@chief-editor/runtime"),react_1=__importStar(require("react")),template_1=require("../context/template");exports.TemplateRender=react_1.memo((function(e){var t=e.template,r=e.brickId,a=e.boardId,n=__rest(e,["template","brickId","boardId"]),i=null!=r?t.getBrick(r).getNode():null!=a?t.getBoard(a).getNode():t.getNode();return react_1.default.createElement(template_1.TemplateContext.Provider,{value:t},react_1.default.createElement("div",__assign({},n),react_1.default.createElement(runtime_1.RuntimeDispatcher,{node:i})))}));