Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
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
25 changes: 25 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: CI

on:
pull_request:
branches:
- main

jobs:
test:
name: Run tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Flutter
uses: subosito/flutter-action@v2

- name: Install dependencies
working-directory: manylines_editor
run: flutter pub get

- name: Run tests
working-directory: manylines_editor
run: flutter test
48 changes: 48 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Deploy Dart docs to GitHub Pages

on:
push:
branches:
- main
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write


jobs:
build:
name: Build documentation
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Flutter
uses: subosito/flutter-action@v2

- name: Install dependencies
working-directory: manylines_editor
run: flutter pub get

- name: Generate docs
working-directory: manylines_editor
run: dart doc .

- name: Upload Pages artifact from Dart docs
uses: actions/upload-pages-artifact@v3
with:
path: manylines_editor/doc/api
deploy:
name: Deploy to GitHub Pages
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
25 changes: 5 additions & 20 deletions manylines_editor/.metadata
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# This file should be version controlled and should not be manually edited.

version:
revision: "ff37bef603469fb030f2b72995ab929ccfc227f0"
revision: "48c32af0345e9ad5747f78ddce828c7f795f7159"
channel: "stable"

project_type: app
Expand All @@ -13,26 +13,11 @@ project_type: app
migration:
platforms:
- platform: root
create_revision: ff37bef603469fb030f2b72995ab929ccfc227f0
base_revision: ff37bef603469fb030f2b72995ab929ccfc227f0
- platform: android
create_revision: ff37bef603469fb030f2b72995ab929ccfc227f0
base_revision: ff37bef603469fb030f2b72995ab929ccfc227f0
- platform: ios
create_revision: ff37bef603469fb030f2b72995ab929ccfc227f0
base_revision: ff37bef603469fb030f2b72995ab929ccfc227f0
- platform: linux
create_revision: ff37bef603469fb030f2b72995ab929ccfc227f0
base_revision: ff37bef603469fb030f2b72995ab929ccfc227f0
- platform: macos
create_revision: ff37bef603469fb030f2b72995ab929ccfc227f0
base_revision: ff37bef603469fb030f2b72995ab929ccfc227f0
create_revision: 48c32af0345e9ad5747f78ddce828c7f795f7159
base_revision: 48c32af0345e9ad5747f78ddce828c7f795f7159
- platform: web
create_revision: ff37bef603469fb030f2b72995ab929ccfc227f0
base_revision: ff37bef603469fb030f2b72995ab929ccfc227f0
- platform: windows
create_revision: ff37bef603469fb030f2b72995ab929ccfc227f0
base_revision: ff37bef603469fb030f2b72995ab929ccfc227f0
create_revision: 48c32af0345e9ad5747f78ddce828c7f795f7159
base_revision: 48c32af0345e9ad5747f78ddce828c7f795f7159

# User provided section

Expand Down
3 changes: 3 additions & 0 deletions manylines_editor/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# manylines_editor

A new Flutter project.
30 changes: 30 additions & 0 deletions manylines_editor/lib/app/app.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'providers.dart';
import 'theme.dart';
import 'router.dart';
import '../entities/setting/setting_repository.dart';

class ManyllinesApp extends StatelessWidget {
const ManyllinesApp({super.key});

@override
Widget build(BuildContext context) {
return AppProviders(
child: Consumer<SettingRepository>(
builder: (context, settingState, _) {
return MaterialApp(
title: 'Manylines',
theme: AppTheme.light,
darkTheme: AppTheme.dark,
themeMode: settingState.isDarkMode ? ThemeMode.dark : ThemeMode.light,
localizationsDelegates: AppLocalizations.delegates,
supportedLocales: AppLocalizations.supportedLocales,
locale: const Locale('ru', 'RU'),
home: const AppRouter(),
);
},
),
);
}
}
28 changes: 28 additions & 0 deletions manylines_editor/lib/app/providers.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../entities/project/project_repository.dart';
import '../entities/document/document_repository.dart';
import '../entities/setting/setting_repository.dart';

class AppProviders extends StatelessWidget {
final Widget child;

const AppProviders({super.key, required this.child});

@override
Widget build(BuildContext context) {

final projectRepo = ProjectRepository();
final documentRepo = DocumentRepository(projectRepo);
final settingRepo = SettingRepository();

return MultiProvider(
providers: [
ChangeNotifierProvider.value(value: projectRepo),
ChangeNotifierProvider.value(value: documentRepo),
ChangeNotifierProvider.value(value: settingRepo),
],
child: child,
);
}
}
22 changes: 22 additions & 0 deletions manylines_editor/lib/app/router.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../entities/project/project.dart';
import '../pages/projects/projects_page.dart';
import '../pages/workspace/workspace_page.dart';
import '../entities/project/project_repository.dart';

class AppRouter extends StatelessWidget {
const AppRouter({super.key});

@override
Widget build(BuildContext context) {
return Selector<ProjectRepository, Project?>(
selector: (_, repo) => repo.selectedProject,
builder: (context, selectedProject, _) {
return selectedProject == null
? const ProjectsPage()
: const WorkspacePage();
},
);
}
}
33 changes: 33 additions & 0 deletions manylines_editor/lib/app/theme.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import 'package:flutter/material.dart';
import 'package:flutter_quill/flutter_quill.dart' as quill;
import 'package:flutter_localizations/flutter_localizations.dart';

class AppTheme {
static final light = ThemeData(
useMaterial3: true,
colorSchemeSeed: Colors.green,
brightness: Brightness.light,
fontFamily: 'Roboto',
);

static final dark = ThemeData(
useMaterial3: true,
colorSchemeSeed: Colors.green,
brightness: Brightness.dark,
fontFamily: 'Roboto',
);
}

class AppLocalizations {
static const delegates = [
quill.FlutterQuillLocalizations.delegate,
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
];

static const supportedLocales = [
Locale('ru', 'RU'),
Locale('en', 'US'),
];
}
25 changes: 25 additions & 0 deletions manylines_editor/lib/entities/document/document.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import 'package:dart_quill_delta/dart_quill_delta.dart';
import '../glossary_entry/glossary_entry.dart';

class AppDocument {
final String id;
final String name;
int viewCount;
bool isPinned;
String? parentId;
Delta content;
List<GlossaryEntry> glossary; // ✅ Изменяемый список

AppDocument({
required this.id,
required this.name,
this.viewCount = 0,
this.isPinned = false,
this.parentId,
required this.content,
List<GlossaryEntry>? glossary, // ✅ Изменили на nullable
}) : glossary = glossary ?? []; // ✅ Создаём mutable список


bool get isChild => parentId != null;
}
Loading