From 8e079a02176b6ab69e63580f46625a761c25f0f2 Mon Sep 17 00:00:00 2001 From: jimbiscuit Date: Mon, 21 Nov 2022 12:37:07 +0100 Subject: [PATCH] feat: Add possiblity to change start line number --- src/components/Block/DefaultView.jsx | 1 + src/components/Block/schema.js | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/components/Block/DefaultView.jsx b/src/components/Block/DefaultView.jsx index 1b37330..6c478a6 100644 --- a/src/components/Block/DefaultView.jsx +++ b/src/components/Block/DefaultView.jsx @@ -37,6 +37,7 @@ const CodeView = (props) => { diff --git a/src/components/Block/schema.js b/src/components/Block/schema.js index b9ae935..df1e898 100644 --- a/src/components/Block/schema.js +++ b/src/components/Block/schema.js @@ -24,6 +24,10 @@ const messages = defineMessages({ id: 'Wrap Long Lines', defaultMessage: 'Wrap Long Lines', }, + lineNbr: { + id: 'Starting Line Number', + defaultMessage: 'Starting Line Number', + }, }); export const codeSchema = (props) => { @@ -45,7 +49,13 @@ export const codeSchema = (props) => { { id: 'default', title: 'Default', - fields: ['language', 'style', 'showLineNumbers', 'wrapLongLines'], + fields: [ + 'language', + 'style', + 'showLineNumbers', + 'wrapLongLines', + 'lineNbr', + ], }, ], @@ -72,6 +82,11 @@ export const codeSchema = (props) => { default: true, type: 'boolean', }, + lineNbr: { + title: props.intl.formatMessage(messages.lineNbr), + type: 'integer', + default: 1, + }, }, required: ['language'], };