Skip to content

Commit

Permalink
Add offline mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Gk0Wk committed Dec 6, 2023
1 parent 0597388 commit 18ae425
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
run: npm install -g pnpm && pnpm install --no-frozen-lockfile

- name: Build Library and static website
run: pnpm run publish
run: pnpm run publish && pnpm run publish:offline

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { EditingSidebarRight } from './editingSidebar';
import { SectionEditorWidget, ISection } from './widget';
import { EditingSidebarRight } from '../sidebar/editingSidebar';
import { SectionEditorWidget, ISection } from '../widget';

let buttonContent: string | undefined;
// eslint-disable-next-line no-nested-ternary
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SectionEditorWidget, ISection } from './widget';
import { SectionEditorWidget, ISection } from '../widget';

let buttonContent: string | undefined;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { SectionEditorWidget } from './widget';
import type { SectionEditorWidget } from '../widget';

let buttonContent: string | undefined;

Expand Down Expand Up @@ -37,9 +37,9 @@ export const DeleteButton = (
const { start, end, tiddler } = section;
const { fields } = $tw.wiki.getTiddler(tiddler)!;
const { text } = fields;
const newText = `${text.substring(0, start).trimEnd()}\n\n${text
const newText = `${text.substring(0, start).trim()}\n\n${text
.substring(end)
.trimStart()}`.trim();
.trim()}`;
$tw.wiki.addTiddler(new $tw.Tiddler(fields, { text: newText }));
}
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { EditingSidebarRight } from './editingSidebar';
import type { SectionEditorWidget } from './widget';
import { EditingSidebarRight } from '../sidebar/editingSidebar';
import type { SectionEditorWidget } from '../widget';

let buttonContent: string | undefined;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SectionEditorWidget } from './widget';
import { SectionEditorWidget } from '../widget';

let buttonContent: string | undefined;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SectionEditorWidget, ISection } from './widget';
import { SectionEditorWidget, ISection } from '../widget';

let buttonContent: string | undefined;

Expand Down Expand Up @@ -31,9 +31,9 @@ export const SaveButton = (widget: SectionEditorWidget, section: ISection) => {
const tiddler = $tw.wiki.getTiddler(section.tiddler)!.fields;
const newText = `${tiddler.text
.substring(0, section.start)
.trimEnd()}\n\n${text.trim()}\n\n${tiddler.text
.trim()}\n\n${text.trim()}\n\n${tiddler.text
.substring(section.end)
.trimStart()}`.trim();
.trim()}`;
$tw.wiki.addTiddler(new $tw.Tiddler(tiddler, { text: newText }));
$tw.wiki.deleteTiddler(section.editingTiddler!);
delete widget.editingSection;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { CancelButton } from './cancelButton';
import { SaveButton } from './saveButton';
import { SectionEditorWidget, ISection } from './widget';
import { CancelButton } from '../buttons/cancelButton';
import { SaveButton } from '../buttons/saveButton';
import { SectionEditorWidget, ISection } from '../widget';

export const EditingSidebarRight = (
widget: SectionEditorWidget,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { AddButton } from './addButton';
import { DeleteButton } from './deleteButton';
import { EditButton } from './editButton';
import { MenuButton } from './menuButton';
import { SectionEditorWidget } from './widget';
import { AddButton } from '../buttons/addButton';
import { DeleteButton } from '../buttons/deleteButton';
import { EditButton } from '../buttons/editButton';
import { MenuButton } from '../buttons/menuButton';
import { SectionEditorWidget } from '../widget';

export const PreviewSidebarLeft = (
widget: SectionEditorWidget,
Expand Down
2 changes: 1 addition & 1 deletion src/sections/widget/widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type {
} from 'tiddlywiki';
import { split } from './split';
import { SectionBackground } from './sectionBackground';
import { PreviewSidebarLeft, PreviewSidebarRight } from './previewSidebar';
import { PreviewSidebarLeft, PreviewSidebarRight } from './sidebar/previewSidebar';

import { widget as Widget } from '$:/core/modules/widgets/widget.js';

Expand Down

0 comments on commit 18ae425

Please sign in to comment.