From 46f782393b20af30478ba19838a8d700e1b97f71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B1=9F=E5=AE=9C=E9=99=9E?= Date: Fri, 14 Jun 2024 18:53:52 +0800 Subject: [PATCH] feat: support read only --- packages/package.json | 2 +- packages/perseus/src/renderer.tsx | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/package.json b/packages/package.json index aa166b305f..b7920f5ac6 100644 --- a/packages/package.json +++ b/packages/package.json @@ -1,6 +1,6 @@ { "name": "@junyiacademy/perseus-core", - "version": "1.0.35", + "version": "1.0.36", "main": "./dist/index.js", "types": "./dist/index.d.ts", "license": "MIT", diff --git a/packages/perseus/src/renderer.tsx b/packages/perseus/src/renderer.tsx index 27d27b4af8..cc15084678 100644 --- a/packages/perseus/src/renderer.tsx +++ b/packages/perseus/src/renderer.tsx @@ -172,6 +172,7 @@ type Props = Partial> & { widgets: PerseusRenderer["widgets"]; // Skip adding paragraph class inline?: boolean; + readyOnly?: boolean; isPrinterView?: boolean; parentGroups?: {id: string; groupType: string}[]; }; @@ -630,6 +631,7 @@ class Renderer extends React.Component { }, trackInteraction: interactionTracker.track, isLastUsedWidget: id === this.state.lastUsedWidgetId, + readOnly: this.props.readOnly, isPrinterView: this.props.isPrinterView, ...(this.props.parentGroups ? {parentGroups: this.props.parentGroups}