Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial implementation #1

Merged
merged 41 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
51290a1
feat: add initial implementation
mlopezFC May 22, 2024
f6385b9
build: update to Vaadin 24.4.0.beta5
mlopezFC Jun 4, 2024
b070d2f
fix: use stylename as the state name
mlopezFC Jun 4, 2024
3d06b5d
fix(demo): fix initial demo values
mlopezFC Jun 4, 2024
7305e63
fix: fix issue caused by null style initial value
mlopezFC Jun 4, 2024
863cfbe
docs: update license headers
mlopezFC Jun 4, 2024
ac113f0
docs: update license header
mlopezFC Jun 4, 2024
8de2dd2
build: fix addon name in scm section
mlopezFC Jun 4, 2024
d8515e1
build: fix inception year
mlopezFC Jun 4, 2024
c49c77b
build: fix group id
mlopezFC Jun 4, 2024
9004001
docs: replace README default values with correct ones
mlopezFC Jun 4, 2024
1719ec2
docs: add javadocs
mlopezFC Jun 4, 2024
042f5b6
fix: use correct default style and content
mlopezFC Jun 4, 2024
c63e770
test: add basic unit testing
mlopezFC Jun 4, 2024
ec5cc99
build: use correct group id
mlopezFC Jul 30, 2024
5bae572
docs: fix Maven Central badge
mlopezFC Jul 30, 2024
33b36fe
docs: fix spelling of add-on
mlopezFC Jul 30, 2024
4eb83d2
test: use correct tag name
mlopezFC Jul 30, 2024
01397ea
docs: fix vaadin directory badges
mlopezFC Jul 30, 2024
19841b0
docs: fix vaadin directory url
mlopezFC Jul 30, 2024
60be801
docs: add javadoc for enums
mlopezFC Jul 30, 2024
5732a78
fix: correct routes to make them similar to other addons
mlopezFC Jul 30, 2024
b8b1d25
build: use latest commons demo version
mlopezFC Jul 30, 2024
029378f
chore: replace addon name in ISSUE_TEMPLATE
mlopezFC Jul 31, 2024
0498cd3
chore: fix how to ignore resources
mlopezFC Jul 31, 2024
0c1b4c3
feat(demo): add missing @GithubBranch annotation
mlopezFC Jul 31, 2024
6a62014
feat: improve constructors
mlopezFC Jul 31, 2024
aff45fd
docs: improve javadocs
mlopezFC Jul 31, 2024
c162ee4
refactor: use a BaseSyntaxHighlighter class to reuse code
mlopezFC Jul 31, 2024
052586f
docs: add missing javadoc
mlopezFC Jul 31, 2024
01a1de1
fix: use correct property name
mlopezFC Aug 5, 2024
a65bfb0
docs: remove initial lines
mlopezFC Aug 5, 2024
f09d555
docs: use allowed instead of whitelisted
mlopezFC Aug 5, 2024
3e67144
docs: update the location of the released and snapshot versions
mlopezFC Aug 5, 2024
e02cb60
fix: rename wrapLines attribute to wrapLongLines
mlopezFC Aug 12, 2024
18fe5f9
refactor: use correct camel case capitalization for SHLanguage class
mlopezFC Aug 13, 2024
2085551
refactor(demo): use multiline text blocks
mlopezFC Aug 13, 2024
8ec224a
refactor: fix camel case capitalization for SHLanguagePrism class
mlopezFC Aug 13, 2024
05264c0
refactor: use correct camel case capitalization for SHStyle class
mlopezFC Aug 13, 2024
9be66ef
refactor: use correct camel case capitalization for SHStylePrism class
mlopezFC Aug 13, 2024
a9842e4
refactor: fix capitalization of getters and setters of SHLanguage
mlopezFC Aug 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ drivers
tsconfig.json
.idea
types.d.ts
/frontend/generated
/frontend/index.html
src/main/frontend/generated
vite.generated.ts
vite.config.ts
/src/main/dev-bundle
mlopezFC marked this conversation as resolved.
Show resolved Hide resolved
39 changes: 25 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,33 @@
[![Published on Vaadin Directory](https://img.shields.io/badge/Vaadin%20Directory-published-00b4f0.svg)](https://vaadin.com/directory/component/template-addon)
[![Stars on vaadin.com/directory](https://img.shields.io/vaadin-directory/star/template-addon.svg)](https://vaadin.com/directory/component/template-addon)
[![Build Status](https://jenkins.flowingcode.com/job/template-addon/badge/icon)](https://jenkins.flowingcode.com/job/template-addon)
[![Maven Central](https://img.shields.io/maven-central/v/com.flowingcode.vaadin.addons/template-addon)](https://mvnrepository.com/artifact/com.flowingcode.vaadin.addons/template-addon)
[![Published on Vaadin Directory](https://img.shields.io/badge/Vaadin%20Directory-published-00b4f0.svg)](https://vaadin.com/directory/component/syntax-highlighter-addon)
[![Stars on vaadin.com/directory](https://img.shields.io/vaadin-directory/star/syntax-highlighter-addon.svg)](https://vaadin.com/directory/component/syntax-highlighter-addon)
mlopezFC marked this conversation as resolved.
Show resolved Hide resolved
[![Build Status](https://jenkins.flowingcode.com/job/syntax-highlighter-addon/badge/icon)](https://jenkins.flowingcode.com/job/syntax-highlighter-addon)
[![Maven Central](https://img.shields.io/maven-central/v/org.vaadin.addons.flowingcode/syntax-highlighter-addon)](https://mvnrepository.com/artifact/org.vaadin.addons.flowingcode/template-addon)

mlopezFC marked this conversation as resolved.
Show resolved Hide resolved
# Template Add-on
# SyntaxHighlighter Add-on

This is a template project for building new Vaadin 24 add-ons
This is a wrapper around the [React Syntax Highlighter](https://github.com/react-syntax-highlighter/react-syntax-highlighter) component

## Features

* List the features of your add-on in here
* Supports both hljs and prism modes
* Enums with styles and languages

## Online demo

[Online demo here](http://addonsv24.flowingcode.com/template)
[Online demo here](http://addonsv24.flowingcode.com/syntax-highlighter)

## Download release

[Available in Vaadin Directory](https://vaadin.com/directory/component/template-addon)
[Available in Vaadin Directory](https://vaadin.com/directory/component/syntax-highlighter-addon)

mlopezFC marked this conversation as resolved.
Show resolved Hide resolved
### Maven install

Add the following dependencies in your pom.xml file:

```xml
<dependency>
<groupId>com.flowingcode.vaadin.addons</groupId>
<artifactId>template-addon</artifactId>
<groupId>org.vaadin.addons.flowingcode</groupId>
<artifactId>syntax-highlighter-addon</artifactId>
mlopezFC marked this conversation as resolved.
Show resolved Hide resolved
<version>X.Y.Z</version>
</dependency>
```
Expand All @@ -50,7 +51,7 @@ To see the demo, navigate to http://localhost:8080/

## Release notes

See [here](https://github.com/FlowingCode/TemplateAddon/releases)
See [here](https://github.com/FlowingCode/SyntaxHighlighter/releases)

## Issue tracking

Expand All @@ -75,13 +76,23 @@ Then, follow these steps for creating a contribution:

This add-on is distributed under Apache License 2.0. For license terms, see LICENSE.txt.

TEMPLATE_ADDON is written by Flowing Code S.A.
SyntaxHighlighter Addon is written by Flowing Code S.A.

mlopezFC marked this conversation as resolved.
Show resolved Hide resolved
# Developer Guide

## Getting started

Add your code samples in this section
You can instantiate the add-on by using the following syntax:

SyntaxHighlighter sh = new SyntaxHighlighter(SHLanguage.JAVASCRIPT, SHStyle.A11YDARK, defaultValue, false, false);

You can also change the style and language by calling the appropriate getters:

sh.setSHLanguage(SHLanguage.JAVASCRIPT);

The same with the styling:

sh.setSHStyle(SHStyle.A11YDARK);

## Special configuration when using Spring

mlopezFC marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
18 changes: 9 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.flowingcode.vaadin.addons</groupId>
<artifactId>template-addon</artifactId>
<groupId>org.vaadin.addons.flowingcode</groupId>
mlopezFC marked this conversation as resolved.
Show resolved Hide resolved
<artifactId>syntax-highlighter-addon</artifactId>
<version>1.0.0-SNAPSHOT</version>
<name>Template Add-on</name>
<description>Template Add-on for Vaadin Flow</description>
<name>Syntax Highlighter Add-on</name>
<description>Syntax Highlighter Add-on for Vaadin Flow</description>
<url>https://www.flowingcode.com/en/open-source/</url>

<properties>
<vaadin.version>24.3.0</vaadin.version>
<vaadin.version>24.4.0.beta5</vaadin.version>
<selenium.version>4.10.0</selenium.version>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
Expand All @@ -29,7 +29,7 @@
<url>https://www.flowingcode.com</url>
</organization>

<inceptionYear>2023</inceptionYear>
<inceptionYear>2024</inceptionYear>
<licenses>
<license>
<name>Apache 2</name>
Expand All @@ -39,9 +39,9 @@
</licenses>

<scm>
<url>https://github.com/FlowingCode/AddonStarter24</url>
<connection>scm:git:git://github.com/FlowingCode/AddonStarter24.git</connection>
<developerConnection>scm:git:ssh://[email protected]:/FlowingCode/AddonStarter24.git</developerConnection>
<url>https://github.com/FlowingCode/SyntaxHighlighter</url>
<connection>scm:git:git://github.com/FlowingCode/SyntaxHighlighter.git</connection>
<developerConnection>scm:git:ssh://[email protected]:/FlowingCode/SyntaxHighlighter.git</developerConnection>
<tag>master</tag>
</scm>

Expand Down
43 changes: 43 additions & 0 deletions src/main/frontend/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<!DOCTYPE html>
<!--
#%L
Syntax Highlighter Add-on
%%
Copyright (C) 2024 Flowing Code
%%
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
#L%
-->

<!--
This file is auto-generated by Vaadin.
-->

<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style>
body, #outlet {
height: 100vh;
width: 100%;
margin: 0;
}
</style>
<!-- index.ts is included here automatically (either by the dev server or during the build) -->
</head>
<body>
<!-- This outlet div is where the views are rendered -->
<div id="outlet"></div>
</body>
</html>
Loading
Loading