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

Collection of SecretNote Improvement (until 0829) #57

Merged
merged 32 commits into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
b6836db
feat: baseline version
z0gSh1u Aug 15, 2024
e07a312
feat: add about bar
z0gSh1u Aug 15, 2024
398aa17
feat: stable node color for same name
z0gSh1u Aug 15, 2024
7b83587
feat: add metrics panel
z0gSh1u Aug 19, 2024
3230044
feat: support metrics monitoring of nodes
z0gSh1u Aug 20, 2024
7cdf0bb
feat: add more docs
z0gSh1u Aug 20, 2024
39dae78
feat: support get versions
z0gSh1u Aug 21, 2024
301f25c
feat: misc changes
z0gSh1u Aug 21, 2024
e663799
feat: add more comments
z0gSh1u Aug 21, 2024
a653198
fix: clear outputarea when restart kernel
z0gSh1u Aug 21, 2024
5af564d
feat: more node info and supports LSP
z0gSh1u Aug 22, 2024
5ba880c
feat: use customized drive to take over contents manager's
z0gSh1u Aug 23, 2024
948e74f
feat: make customized drive simple
z0gSh1u Aug 23, 2024
227b59b
fix: download notebook file
z0gSh1u Aug 23, 2024
9c1f27c
refactor: format all
z0gSh1u Aug 23, 2024
be9f206
feat: support ws auth in lsp connection
z0gSh1u Aug 26, 2024
2593b57
fix: format all
z0gSh1u Aug 26, 2024
8493241
fix: encode token
z0gSh1u Aug 26, 2024
fa524a6
feat: support file viewing when no kernel is available
z0gSh1u Aug 26, 2024
11c3d78
fix: top toolbar run is invalid
z0gSh1u Aug 26, 2024
6e58df0
feat: use markdown to render welcome docs
z0gSh1u Aug 27, 2024
6c5b4ee
feat: toolbar run button and show loading when uploading
z0gSh1u Aug 27, 2024
1b02ed6
fix: the time sequence of defaultServerManager's launch
z0gSh1u Aug 27, 2024
f165894
chore: misc changes to the toolchain
z0gSh1u Aug 27, 2024
4cc7e1a
feat: correct file path for new drive and add busy status for file list
z0gSh1u Aug 28, 2024
ce8f175
fix: stream stderr being missing
z0gSh1u Aug 28, 2024
45bae9f
fix: rename welcome
z0gSh1u Aug 28, 2024
77ba362
fix: sanitize code
z0gSh1u Aug 28, 2024
ef4b9db
chore: sanitize deps
z0gSh1u Aug 28, 2024
c2a58b6
fix: remove debug settings
z0gSh1u Aug 28, 2024
273cb3e
refactor: format all
z0gSh1u Aug 28, 2024
7efee8a
chore: optimize packaging
z0gSh1u Aug 28, 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
1 change: 1 addition & 0 deletions docker/app/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ RUN npm config set registry https://registry.npmmirror.com
RUN npm install @difizen/libro-analyzer

COPY --from=build /dist /dist
RUN pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/
RUN pip install /dist/pyprojects/secretnote/dist/*.whl

WORKDIR /home/secretnote
Expand Down
2 changes: 2 additions & 0 deletions packages/secretnote-lite/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
dist
31 changes: 18 additions & 13 deletions packages/secretnote-lite/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@alipay/secretnote-lite",
"version": "0.0.34",
"version": "0.0.42",
"license": "Apache-2.0",
"author": "vectorse@126.com",
"repository": "https://github.com/secretflow/secretnote/tree/main/packages/secretnote",
Expand All @@ -9,25 +9,27 @@
"dist",
"src"
],
"main": "dist/index.cjs.js",
"module": "dist/index.esm.js",
"types": "dist/typing/index.d.ts",
"main": "dist/index.js",
"module": "dist/index.js",
"types": "dist/index.d.ts",
"scripts": {
"setup": "tsup src/index.tsx",
"build": "tsup src/index.tsx",
"build": "tsup src/index.tsx --inject ./react-shim.js",
"dev": "tsup src/index.tsx --watch",
"lint:eslint": "eslint src",
"lint:stylelint": "stylelint 'src/**/*.{css,less}'",
"pb": "pnpm publish --no-git-checks --filter @secretflow/secretnote-lite"
},
"dependencies": {
"@antv/s2": "^1.52.0",
"@difizen/libro-jupyter": "^0.1.22",
"@difizen/mana-app": "^0.1.10",
"@difizen/mana-common": "^0.1.10",
"@difizen/mana-l10n": "^0.1.10",
"@difizen/mana-react": "^0.1.10",
"@difizen/libro-jupyter": "^0.2.20",
"@difizen/libro-language-client": "^0.2.20",
"@difizen/mana-app": "^0.1.19",
"@difizen/mana-common": "^0.1.19",
"@difizen/mana-l10n": "^0.1.19",
"@difizen/mana-react": "^0.1.19",
"@kanaries/web-data-loader": "^0.1.7",
"@lumino/polling": "^2.1.3",
"@tiptap/core": "^2.1.11",
"@tiptap/extension-color": "^2.1.11",
"@tiptap/extension-highlight": "^2.1.11",
Expand All @@ -43,11 +45,13 @@
"@tiptap/starter-kit": "^2.1.11",
"@tiptap/suggestion": "^2.1.11",
"ahooks": "^3.7.8",
"canvas-confetti": "^1.9.0",
"classnames": "^2.3.2",
"d3-dsv": "^3.0.1",
"highlight.js": "^11.9.0",
"lodash-es": "^4.17.21",
"lucide-react": "^0.284.0",
"markdown-it": "^14.1.0",
"monaco-editor": "^0.45.0",
"monaco-editor-webpack-plugin": "^7.1.0",
"styled-components": "^6.1.0",
Expand All @@ -57,8 +61,7 @@
"xterm-addon-canvas": "^0.5.0",
"xterm-addon-fit": "^0.8.0",
"xterm-addon-search": "^0.13.0",
"xterm-addon-web-links": "^0.9.0",
"canvas-confetti": "^1.9.0"
"xterm-addon-web-links": "^0.9.0"
},
"peerDependencies": {
"antd": "^5.10.1",
Expand All @@ -71,7 +74,9 @@
"@types/react": "^18.2.28",
"@types/react-dom": "^18.2.13",
"colorette": "^2.0.19",
"esbuild-plugin-svgr": "^1.1.0"
"esbuild-plugin-svgr": "^1.1.0",
"tsup": "^8.2.4",
"typescript": "^5.5.4"
},
"publishConfig": {
"registry": "https://registry.antgroup-inc.cn"
Expand Down
2 changes: 2 additions & 0 deletions packages/secretnote-lite/react-shim.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import React from 'react';
export { React };
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
.ant-dropdown-menu-item {
padding: 4px 8px;
border-radius: 0;
font-size: 12px;
font-size: 13px;
font-weight: 400;

.ant-dropdown-menu-item-icon {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ interface IProps {
onClick?: (key: string) => void;
trigger?: ('click' | 'hover' | 'contextMenu')[];
icon?: React.ReactNode;
disabled?: boolean;
}

function DropdownMenu(props: IProps) {
const { items, onClick, icon, trigger } = props;
const { items, onClick, icon, trigger, disabled } = props;

if (items.length === 0) {
return null;
Expand All @@ -34,6 +35,7 @@ function DropdownMenu(props: IProps) {
}}
overlayClassName="secretnote-dropdown-menu"
trigger={trigger || ['click']}
disabled={disabled}
>
<span onClick={(e) => e.stopPropagation()}>
{icon ? icon : <MoreHorizontal size={14} />}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { l10n } from '@difizen/mana-l10n';
import { InputRule } from '@tiptap/core';
import { Color } from '@tiptap/extension-color';
import { Highlight } from '@tiptap/extension-highlight';
Expand All @@ -9,9 +10,7 @@ import { TaskList } from '@tiptap/extension-task-list';
import { TextStyle } from '@tiptap/extension-text-style';
import TiptapUnderline from '@tiptap/extension-underline';
import { StarterKit } from '@tiptap/starter-kit';
import React from 'react';
import { Markdown } from 'tiptap-markdown';

import SlashCommand from './slash-command';

export const defaultExtensions = [
Expand Down Expand Up @@ -88,9 +87,9 @@ export const defaultExtensions = [
Placeholder.configure({
placeholder: ({ node }) => {
if (node.type.name === 'heading') {
return `Heading ${node.attrs.level}`;
return `标题 ${node.attrs.level}`;
}
return "Press '/' for commands";
return l10n.t('键入 / 查看更多命令');
},
includeChildren: true,
}),
Expand Down
2 changes: 1 addition & 1 deletion packages/secretnote-lite/src/components/ribbon/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function Ribbon(props: RibbonProps) {
const getLabel = (values: string[]) => {
const filterItems = items.filter((item) => values.includes(item.key));
if (filterItems.length === 0) {
return 'Select Nodes';
return l10n.t('选择执行节点...');
}
return filterItems.map((item) => item.label).join(',');
};
Expand Down
10 changes: 9 additions & 1 deletion packages/secretnote-lite/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import '@/lang';
import { ManaAppPreset, ManaComponents } from '@difizen/mana-app';
import React from 'react';
import { message } from 'antd';

import { EditorModule } from '@/modules/editor';
import { FileModule } from '@/modules/file';
Expand All @@ -12,6 +12,7 @@ import { StorageModule } from '@/modules/storage';
import { ThemeModule } from '@/modules/theme';
import { ToolbarModule } from '@/modules/toolbar';
import { WelcomeModule } from '@/modules/welcome';
import { MetricsModule } from './modules/metrics';
import './override.less';

const App = (): JSX.Element => {
Expand All @@ -25,13 +26,20 @@ const App = (): JSX.Element => {
ThemeModule,
StorageModule,
EditorModule,
MetricsModule,
NodeModule,
NotebookModule,
FileModule,
MarkdownCellModule,
ToolbarModule,
WelcomeModule,
]}
onReady={() => {
// do some initialization
message.config({
maxCount: 1,
});
}}
/>
);
};
Expand Down
4 changes: 2 additions & 2 deletions packages/secretnote-lite/src/lang/bundle.l10n.en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@
"运行 Cell": "Run Cell",
"运行上方所有 Cell": "Run all cells above",
"运行当前及下方所有 Cell": "Run the current and all cells below",
"kernel准备中,无法执行": "kernel preparation, unable to execute",
"Kernel 准备中,无法执行": "Kernel preparation, unable to execute",
"运行当前Cell": "Run the current Cell",
"运行全部": "Run all",
"运行之前所有cell": "All cells before running",
Expand Down Expand Up @@ -320,4 +320,4 @@
"类型": "Type",
"请选择节点类型": "Please select a node type",
"通用": "Common"
}
}
4 changes: 2 additions & 2 deletions packages/secretnote-lite/src/lang/bundle.l10n.zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@
"运行 Cell": "运行 Cell",
"运行上方所有 Cell": "运行上方所有 Cell",
"运行当前及下方所有 Cell": "运行当前及下方所有 Cell",
"kernel准备中,无法执行": "kernel准备中,无法执行",
"Kernel 准备中,无法执行": "Kernel 准备中,无法执行",
"运行当前Cell": "运行当前Cell",
"运行全部": "运行全部",
"运行之前所有cell": "运行之前所有cell",
Expand Down Expand Up @@ -320,4 +320,4 @@
"类型": "类型",
"请选择节点类型": "请选择节点类型",
"通用": "通用"
}
}
17 changes: 8 additions & 9 deletions packages/secretnote-lite/src/lang/index.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import type { LanguageBundles } from '@difizen/mana-l10n';
import { l10n, L10nLang } from '@difizen/mana-l10n';
// Multilingual support

import lang_en_us from './bundle.l10n.en-US.json';
import lang_zh_cn from './bundle.l10n.zh-CN.json';
import { l10n, L10nLang } from '@difizen/mana-l10n';

export const langBundles: LanguageBundles = {
'zh-CN': lang_zh_cn,
'en-US': lang_en_us,
};
import bundleENUS from './bundle.l10n.en-US.json';
import bundleZHCN from './bundle.l10n.zh-CN.json';

l10n.loadLangBundles(langBundles);
l10n.loadLangBundles({
'zh-CN': bundleZHCN,
'en-US': bundleENUS,
});
l10n.changeLang(L10nLang.zhCN);
Loading
Loading