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

feat: update Web IDE with TON branding #109

Merged
merged 8 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
96 changes: 5 additions & 91 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,95 +1,9 @@
Business Source License 1.1
MIT License

License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved.
"Business Source License" is a trademark of MariaDB Corporation Ab.
Copyright 2024 TON Community

-----------------------------------------------------------------------------
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Parameters
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

Licensor: Nujan

Additional Use Grant: Any uses listed and defined at
https://nujan.io/

Applied Date: 13-03-2023


-----------------------------------------------------------------------------

Terms

The Licensor hereby grants you the right to copy, modify, create derivative
works, redistribute, and make non-production use of the Licensed Work. The
Licensor may make an Additional Use Grant, above, permitting limited
production use.

Effective on the Change Date, or the fourth anniversary of the first publicly
available distribution of a specific version of the Licensed Work under this
License, whichever comes first, the Licensor hereby grants you rights under
the terms of the Change License, and the rights granted in the paragraph
above terminate.

If your use of the Licensed Work does not comply with the requirements
currently in effect as described in this License, you must purchase a
commercial license from the Licensor, its affiliated entities, or authorized
resellers, or you must refrain from using the Licensed Work.

All copies of the original and modified Licensed Work, and derivative works
of the Licensed Work, are subject to this License. This License applies
separately for each version of the Licensed Work and the Change Date may vary
for each version of the Licensed Work released by Licensor.

You must conspicuously display this License on each original or modified copy
of the Licensed Work. If you receive the Licensed Work in original or
modified form from a third party, the terms and conditions set forth in this
License apply to your use of that work.

Any use of the Licensed Work in violation of this License will automatically
terminate your rights under this License for the current and all other
versions of the Licensed Work.

This License does not grant you any right in any trademark or logo of
Licensor or its affiliates (provided that you may use a trademark or logo of
Licensor as expressly required by this License).

TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
AN "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
TITLE.

MariaDB hereby grants you permission to use this License’s text to license
your works, and to refer to it using the trademark "Business Source License",
as long as you comply with the Covenants of Licensor below.

-----------------------------------------------------------------------------

Covenants of Licensor

In consideration of the right to use this License’s text and the "Business
Source License" name and trademark, Licensor covenants to MariaDB, and to all
other recipients of the licensed work to be provided by Licensor:

1. To specify as the Change License the GPL Version 2.0 or any later version,
or a license that is compatible with GPL Version 2.0 or a later version,
where "compatible" means that software provided under the Change License can
be included in a program with software provided under GPL Version 2.0 or a
later version. Licensor may specify additional Change Licenses without
limitation.

2. To either: (a) specify an additional grant of rights to use that does not
impose any additional restriction on the right granted in this License, as
the Additional Use Grant; or (b) insert the text "None".

3. To specify a Change Date.

4. Not to modify this License in any other way.

-----------------------------------------------------------------------------

Notice

The Business Source License (this document, or the "License") is not an Open
Source license. However, the Licensed Work will eventually be made available
under an Open Source License, as stated in this License.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
![](https://res.cloudinary.com/don6qaqms/image/upload/v1696056044/k8w16co4k2nsjsrn7sup.jpg)

# What is Nujan?
# What is TON Web IDE?

Web IDE, powered by Nujan, is your ultimate browser-based IDE designed to simplify the journey of writing, testing, compiling, deploying, and interacting with smart contracts on TON. Write smart contracts from anywhere, No setups, no downloads, just pure convenience and versatility.
It is your ultimate browser-based IDE designed to simplify the journey of writing, testing, compiling, deploying, and interacting with smart contracts on TON. Write smart contracts from anywhere, No setups, no downloads, just pure convenience and versatility.

# What we offer 🤝

Expand Down Expand Up @@ -31,4 +31,4 @@ We have put significant effort into developing and refining our codebase, and we

## License

[Business Source License 1.1](https://github.com/rahulyadav-57/ton-ide/blob/main/LICENSE)
MIT
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
{
"name": "nujan-ton-ide",
"name": "ton-web-ide",
"version": "0.1.0",
"private": true,
"author": {
"name": "Rahul Yadav",
"url": "https://github.com/rahulyadav-57/"
},
"scripts": {
"dev": "next dev",
"build": "next build",
Expand Down
2 changes: 1 addition & 1 deletion public/assets/ton/tonconnect-manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"url": "https://ide.nujan.io/",
"name": "Nujan",
"name": "TON Web IDE",
"iconUrl": "https://ide.nujan.io/images/logo.png"
}
2 changes: 1 addition & 1 deletion public/html/testcases.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
!event.data ||
typeof event.data !== "object" ||
!event.data?.type ||
event.data?.name !== "nujan-ton-ide" ||
event.data?.name !== "ton-web-ide" ||
event.data?.type !== "test-cases"
) {
return;
Expand Down
6 changes: 3 additions & 3 deletions public/html/tonweb.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
!event.data ||
typeof event.data !== "object" ||
!event.data?.type ||
event.data?.name !== "nujan-ton-ide"
event.data?.name !== "ton-web-ide"
) {
return;
}
Expand Down Expand Up @@ -48,7 +48,7 @@
}

const response = {
name: "nujan-ton-ide",
name: "ton-web-ide",
data: cellValue,
type: event.data?.type,
};
Expand All @@ -72,7 +72,7 @@
});
const _error = `Error: ${error.message} \n${errorStack.join("\n")}`;
const response = {
name: "nujan-ton-ide",
name: "ton-web-ide",
error: _error,
type: event.data?.type,
};
Expand Down
4 changes: 4 additions & 0 deletions public/images/ton_logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/components/shared/LogView/LogView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ const LogView: FC<Props> = ({ filter }) => {

_terminal.open(appTerminal);
_terminal.writeln(
`${colorMap.info}Welcome to ${AppConfig.name} IDE${colorMap.reset}`,
`${colorMap.info}Welcome to ${AppConfig.name}${colorMap.reset}`,
);
_searchAddon.activate(_terminal);
_fitAddon.fit();
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/AppLogo/AppLogo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ interface Props {
}

const AppLogo: FC<Props> = ({
src = '/images/logo-icon.svg',
src = '/images/ton_logo.svg',
href = '/',
className = '',
}) => {
Expand Down
4 changes: 2 additions & 2 deletions src/components/workspace/BuildProject/BuildProject.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ const BuildProject: FC<Props> = ({ projectId, contract, updateContract }) => {

cellBuilderRef.current.contentWindow.postMessage(
{
name: 'nujan-ton-ide',
name: 'ton-web-ide',
type: 'state-init-data',
code: finalJsoutput,
language: activeProject?.language,
Expand Down Expand Up @@ -653,7 +653,7 @@ const BuildProject: FC<Props> = ({ projectId, contract, updateContract }) => {
if (
typeof event.data !== 'object' ||
event.data.type !== 'state-init-data' ||
event.data.name !== 'nujan-ton-ide'
event.data.name !== 'ton-web-ide'
) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useFile } from '@/hooks';
import { useContractAction } from '@/hooks/contract.hooks';
import { useLogActivity } from '@/hooks/logActivity.hooks';
import { useProject } from '@/hooks/projectV2.hooks';
import { baseProjectPath, useProject } from '@/hooks/projectV2.hooks';
import { CellABI, ProjectSetting } from '@/interfaces/workspace.interface';
import { buildTs } from '@/utility/typescriptHelper';
import { Cell } from '@ton/core';
Expand Down Expand Up @@ -70,7 +70,7 @@ const FuncContractInteraction: FC<ProjectInteractionProps> = ({

cellBuilderRef.current.contentWindow.postMessage(
{
name: 'nujan-ton-ide',
name: 'ton-web-ide',
type: 'abi-data',
code: finalJsoutput,
},
Expand Down Expand Up @@ -133,7 +133,7 @@ const FuncContractInteraction: FC<ProjectInteractionProps> = ({
if (
typeof event.data !== 'object' ||
event.data.type !== 'abi-data' ||
event.data.name !== 'nujan-ton-ide'
event.data.name !== 'ton-web-ide'
) {
setIsLoading('');
return;
Expand Down Expand Up @@ -170,10 +170,13 @@ const FuncContractInteraction: FC<ProjectInteractionProps> = ({
src="/html/tonweb.html"
sandbox="allow-scripts allow-same-origin"
/>
<p className="color-warn">
You are using code that has been imported from an external source.
Exercise caution with the contract code before executing it.
</p>
{activeProject?.path === `${baseProjectPath}/temp` && (
<p className="color-warn">
You are using code that has been imported from an external source.
Exercise caution with the contract code before executing it.
</p>
)}

<p>
Below options will be used to send internal message and call getter
method on contract after the contract is deployed.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { baseProjectPath, useProject } from '@/hooks/projectV2.hooks';
import { TactType } from '@/interfaces/workspace.interface';
import { FC } from 'react';
import { TactABIUi } from '../ABIUi';
Expand All @@ -10,16 +11,20 @@ const TactContractInteraction: FC<ProjectInteractionProps> = ({
network,
contract = null,
}) => {
const { activeProject } = useProject();

if (!contractAddress || !abi) {
return <></>;
}

return (
<div className={s.root}>
<p className="color-warn">
You are using code that has been imported from an external source.
Exercise caution with the contract code before executing it.
</p>
{activeProject?.path === `${baseProjectPath}/temp` && (
<p className="color-warn">
You are using code that has been imported from an external source.
Exercise caution with the contract code before executing it.
</p>
)}
<p>
Below options will be used to call receiver and call getter method on
contract after the contract is deployed.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { AppData } from '@/constant/AppData';
import { useSettingAction } from '@/hooks/setting.hooks';
import { Form, Input, Popover, Select, Switch } from 'antd';
import Link from 'next/link';
import { FC } from 'react';
import { FC, useEffect } from 'react';
import s from './WorkspaceSidebar.module.scss';

export type WorkSpaceMenu = 'code' | 'build' | 'test-cases' | 'setting';
Expand Down Expand Up @@ -59,6 +59,12 @@ const WorkspaceSidebar: FC<Props> = ({
},
];

useEffect(() => {
if (!projectName) {
onMenuClicked('code');
}
}, []);

const settingContent = () => (
<div>
<div className={s.settingItem}>
Expand Down
4 changes: 2 additions & 2 deletions src/config/AppConfig.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export const AppConfig = {
name: 'Nujan',
name: 'TON Web IDE',
seo: {
title: 'Nujan IDE',
title: 'TON Web IDE',
},
network: 'testnet',
API_URL: process.env.NEXT_PUBLIC_API_URL ?? 'http://127.0.0.1:3000',
Expand Down
8 changes: 6 additions & 2 deletions src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default function App({
file: {
contents: `
{
"name": "nujan-app",
"name": "ton-web-ide-app",
"type": "module",
"dependencies": {
"jest": "29.6.2",
Expand Down Expand Up @@ -82,7 +82,11 @@ export default function App({
<title>{AppConfig.seo.title}</title>
<meta name="description" content="" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" type="image/png" href="/images/logo.png" />
<link
rel="icon"
type="image/image/svg+xml"
href="/images/ton_logo.svg"
/>
</Head>
<RecoilRoot>
<IDEProvider>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/_document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default function Document() {
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" />
<link
href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&Josefin+Sans&display=swap"
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap"
rel="stylesheet"
/>
</Head>
Expand Down
Loading
Loading