@chief-editor/preview
Version:
FlowEditor Editor
1 lines • 1.1 kB
JavaScript
var __assign=this&&this.__assign||function(){return(__assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},__rest=this&&this.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r};import{RuntimeDispatcher}from"@chief-editor/runtime";import React,{memo}from"react";import{TemplateContext}from"../context/template";export var TemplateRender=memo((function(e){var t=e.template,r=e.brickId,n=e.boardId,o=__rest(e,["template","brickId","boardId"]),a=null!=r?t.getBrick(r).getNode():null!=n?t.getBoard(n).getNode():t.getNode();return React.createElement(TemplateContext.Provider,{value:t},React.createElement("div",__assign({},o),React.createElement(RuntimeDispatcher,{node:a})))}));