Compare commits

...
Author SHA1 Message Date
StandardNotes CI 8863ee82bb chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected].3
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].2
2022-10-09 15:47:24 +00:00
Aman Harwara 6a4b5c5cdc fix: move viewport early return above 2022-10-09 20:39:48 +05:30
Aman Harwara cd1669f56f fix: potential fix for viewport height issue (#1772) 2022-10-09 20:37:44 +05:30
StandardNotes CI 037007f0ec chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected].2
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].1
2022-10-08 08:12:13 +00:00
Aman Harwara e7ca12babe fix: open upgrade page in new tab if user has account 2022-10-08 13:12:32 +05:30
StandardNotes CI c4c33db1a4 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected].1
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].0
2022-10-07 20:41:32 +00:00
Aman Harwara 734b986294 feat: open purchase flow when clicking upgrade cta with no account (#1771) 2022-10-08 01:39:40 +05:30
Aman Harwara 59db63f052 feat: change quick settings menu layout (#1770) 2022-10-08 01:08:54 +05:30
Mo 20226c3269 fix(desktop): use different method to send messages across main and render without node integration in preload (#1769) 2022-10-07 14:30:07 -05:00
StandardNotes CI a1352d9f65 chore(release): publish
- @standardnotes/[email protected].0
 - @standardnotes/[email protected]
2022-10-07 13:57:12 +00:00
Mo 7d21046b51 feat(mobile): delete account option in settings (#1768) 2022-10-07 08:23:18 -05:00
Mo a365c17c46 fix(mobile): disable landscape for iPhone 2022-10-07 07:27:37 -05:00
StandardNotes CI c1981334e1 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected].2
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].5
2022-10-07 10:51:03 +00:00
Aman Harwara 1e3acd50e9 fix: add fallback for viewport height on mobile (#1766) 2022-10-07 15:41:45 +05:30
StandardNotes CI 8de6023848 chore(release): publish
- @standardnotes/[email protected].0
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].1
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].4
2022-10-07 09:13:30 +00:00
Karol Sójko 01ba715eba feat(api): add workspaces api (#1765)
* feat(api): add workspaces api

* fix(api): lint issues
2022-10-07 10:36:30 +02:00
StandardNotes CI 3733707bf1 chore(release): publish
- @standardnotes/[email protected].0
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].3
2022-10-06 21:43:54 +00:00
Mo cbbe913cd6 feat: experimental 005 operator (#1753) 2022-10-06 11:03:43 -05:00
Mo c13dd883a4 fix(mobile): reenable bouncing in lists 2022-10-06 09:56:56 -05:00
Aman Harwara 1377846f3f fix: dark mode toggling 2022-10-06 18:53:27 +05:30
StandardNotes CI f9ee197f04 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].2
2022-10-06 12:35:47 +00:00
Aman Harwara c944eb9365 fix: increase default editor font size on mobile 2022-10-06 17:35:53 +05:30
StandardNotes CI 4609053bd0 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
2022-10-06 11:25:46 +00:00
Aman Harwara 1c10214104 chore: remove unused dev build gh release (#1750) 2022-10-06 16:23:59 +05:30
Aman Harwara 1602d8157f fix: add android platform check for status bar color sync 2022-10-06 16:22:25 +05:30
StandardNotes CI ed1d583476 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].1
2022-10-06 08:53:37 +00:00
Aman Harwara 05aff2776b fix: add fallback for initial window size (#1749) 2022-10-06 13:49:06 +05:30
StandardNotes CI 4b6662d62d chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].9
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].3
 - @standardnotes/[email protected].9
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2022-10-05 20:52:08 +00:00
StandardNotes CI ac0ad49af0 chore(release): components 2022-10-05 20:51:54 +00:00
Aman Harwara 09b994f8f9 feat: add free dark mode (#1748) 2022-10-06 01:49:35 +05:30
Mo 6c26b96cdc fix(mobile): passcode timing options (#1744) 2022-10-05 10:08:54 -05:00
StandardNotes CI a4de9a05a9 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].8
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].1
2022-10-05 13:48:42 +00:00
Mo 6bd5534f74 fix: prevent overflow bouncing on desktop and mobile (#1743)
* fix: prevent overflow bouncing on desktop and mobile

* fix: add black bg to webview for debugging purposes
2022-10-05 08:19:55 -05:00
Robbe Van Herck de0f91c9e3 fix(docs): Change order of sed commands (#1742)
As it was before, the value "secret" in "secret_key" and "jegacy_jwt_secret" would be replaced by the key generated for "secret". This reduced the security of the keys as all three keys would be almost the same. By moving the command for secret to the bottom, this problem no longer occurs.
2022-10-05 08:17:35 -05:00
StandardNotes CI 7fb418472c chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected].7
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].0
2022-10-05 13:08:34 +00:00
Aman Harwara 376810e657 feat: add file info panel button to file view (#1741) 2022-10-05 18:08:34 +05:30
StandardNotes CI c58eb611ac chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].2
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].6
 - @standardnotes/[email protected].1
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].4
 - @standardnotes/[email protected].2
 - @standardnotes/[email protected].8
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].6
2022-10-05 12:23:24 +00:00
StandardNotes CI 1167a674d6 chore(release): components 2022-10-05 12:23:06 +00:00
Mo 8ef5a33994 refactor: remove advanced-checklist editor (moved to community plugins) (#1740) 2022-10-05 06:43:48 -05:00
StandardNotes CI ec41d082ff chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected].5
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].5
2022-10-04 19:27:04 +00:00
Aman Harwara 1c603161a5 fix: increase context menu item font size on mobile (#1738) 2022-10-05 00:28:37 +05:30
StandardNotes CI b50dc861cd chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected].4
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].4
2022-10-04 16:44:19 +00:00
Aman Harwara b4eacd0f2a fix: attached file renaming on mobile 2022-10-04 21:40:33 +05:30
Aman Harwara 927938cb56 fix: android monospace font (#1735) 2022-10-04 21:20:21 +05:30
StandardNotes CI ca170a2fa0 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected].3
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].3
2022-10-04 12:26:48 +00:00
Aman Harwara 782cbee97e fix: preferences on mobile webview when zoomed in (#1731) 2022-10-04 17:24:48 +05:30
StandardNotes CI c1e6f8027e chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected].2
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].2
2022-10-03 13:53:52 +00:00
Aman Harwara b9b84c79d5 fix: resizing in desktop app 2022-10-03 18:52:52 +05:30
StandardNotes CI 4971e3c56e chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].1
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].1
 - @standardnotes/[email protected].7
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].1
2022-10-03 08:24:54 +00:00
Karol Sójko d54e6965c1 feat(api): add http status code for gone resource 2022-10-03 09:54:18 +02:00
StandardNotes CI ca144be66a chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected].6
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].0
2022-10-02 18:16:57 +00:00
Aman Harwara a90e4a50e8 feat: use native preview for pdf in mobile webview (#1728) 2022-10-02 23:10:44 +05:30
StandardNotes CI 65818ac1cd chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected].1
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].4
2022-10-02 16:48:10 +00:00
Aman Harwara 52962ed65d fix: text wrapping in notes list panel title 2022-10-02 21:40:49 +05:30
StandardNotes CI be2c4720fc chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected].5
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].3
2022-09-30 19:58:37 +00:00
Aman Harwara 47106fdf83 feat: sync android status bar bg with theme bg color (#1727) 2022-10-01 00:58:16 +05:30
StandardNotes CI 88e29fe1b6 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].2
2022-09-30 17:32:50 +00:00
Aman Harwara b15d80eb29 fix: files download in mobile webview (#1726) 2022-09-30 22:31:49 +05:30
311 changed files with 2130 additions and 8468 deletions
-10
View File
@@ -48,16 +48,6 @@ jobs:
uses: martinbeentjes/npm-get-version-action@main
with:
path: packages/mobile
- name: Release
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.CI_PAT_TOKEN }}
tag_name: "@standardnotes/mobile@${{ steps.package-version.outputs.current-version}}"
prerelease: true
draft: true
name: "Mobile Dev ${{ steps.package-version.outputs.current-version }}"
files: |
packages/mobile/android/app/build/outputs/apk/dev/release/app-dev-release.apk
ios:
defaults:
run:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+26
View File
@@ -3,6 +3,32 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [1.11.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-10-07)
### Features
* **api:** add workspaces api ([#1765](https://github.com/standardnotes/app/issues/1765)) ([01ba715](https://github.com/standardnotes/app/commit/01ba715eba987a7da1ee062fec0b3593a7a453ed))
# [1.10.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-10-06)
### Features
* experimental 005 operator ([#1753](https://github.com/standardnotes/app/issues/1753)) ([cbbe913](https://github.com/standardnotes/app/commit/cbbe913cd6eb694dd27997927bd5c45e8a64cc09))
## [1.9.2](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-10-05)
**Note:** Version bump only for package @standardnotes/api
## [1.9.1](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-10-05)
**Note:** Version bump only for package @standardnotes/api
# [1.9.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-10-03)
### Features
* **api:** add http status code for gone resource ([d54e696](https://github.com/standardnotes/app/commit/d54e6965c188e9f12371b32868e8de1c2f627f30))
## [1.8.7](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-30)
**Note:** Version bump only for package @standardnotes/api
+4 -4
View File
@@ -10,10 +10,10 @@ module.exports = {
},
coverageThreshold: {
global: {
branches: 20,
functions: 66,
lines: 63,
statements: 63
branches: 22,
functions: 69,
lines: 67,
statements: 67
}
}
};
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/api",
"version": "1.8.7",
"version": "1.11.0",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
@@ -1,5 +1,4 @@
import { RootKeyParamsInterface } from '@standardnotes/models'
import { ErrorMessage } from '../../Error/ErrorMessage'
import { ApiCallError } from '../../Error/ApiCallError'
import { UserRegistrationResponse } from '../../Response/User/UserRegistrationResponse'
@@ -0,0 +1,3 @@
export enum WorkspaceApiOperations {
Creating,
}
@@ -0,0 +1,76 @@
import { WorkspaceCreationResponse } from '../../Response/Workspace/WorkspaceCreationResponse'
import { WorkspaceServerInterface } from '../../Server/Workspace/WorkspaceServerInterface'
import { WorkspaceApiOperations } from './WorkspaceApiOperations'
import { WorkspaceApiService } from './WorkspaceApiService'
describe('WorkspaceApiService', () => {
let workspaceServer: WorkspaceServerInterface
const createService = () => new WorkspaceApiService(workspaceServer)
beforeEach(() => {
workspaceServer = {} as jest.Mocked<WorkspaceServerInterface>
workspaceServer.createWorkspace = jest.fn().mockReturnValue({
data: { uuid: '1-2-3' },
} as jest.Mocked<WorkspaceCreationResponse>)
})
it('should create a workspace', async () => {
const response = await createService().createWorkspace({
encryptedPrivateKey: 'foo',
encryptedWorkspaceKey: 'bar',
publicKey: 'buzz',
})
expect(response).toEqual({
data: {
uuid: '1-2-3',
},
})
expect(workspaceServer.createWorkspace).toHaveBeenCalledWith({
encryptedPrivateKey: 'foo',
encryptedWorkspaceKey: 'bar',
publicKey: 'buzz',
})
})
it('should not create a workspace if it is already creating', async () => {
const service = createService()
Object.defineProperty(service, 'operationsInProgress', {
get: () => new Map([[WorkspaceApiOperations.Creating, true]]),
})
let error = null
try {
await service.createWorkspace({
encryptedPrivateKey: 'foo',
encryptedWorkspaceKey: 'bar',
publicKey: 'buzz',
})
} catch (caughtError) {
error = caughtError
}
expect(error).not.toBeNull()
})
it('should not create a workspace if the server fails', async () => {
workspaceServer.createWorkspace = jest.fn().mockImplementation(() => {
throw new Error('Oops')
})
let error = null
try {
await createService().createWorkspace({
encryptedPrivateKey: 'foo',
encryptedWorkspaceKey: 'bar',
publicKey: 'buzz',
})
} catch (caughtError) {
error = caughtError
}
expect(error).not.toBeNull()
})
})
@@ -0,0 +1,43 @@
import { ErrorMessage } from '../../Error/ErrorMessage'
import { ApiCallError } from '../../Error/ApiCallError'
import { WorkspaceCreationResponse } from '../../Response/Workspace/WorkspaceCreationResponse'
import { WorkspaceServerInterface } from '../../Server/Workspace/WorkspaceServerInterface'
import { WorkspaceApiServiceInterface } from './WorkspaceApiServiceInterface'
import { WorkspaceApiOperations } from './WorkspaceApiOperations'
export class WorkspaceApiService implements WorkspaceApiServiceInterface {
private operationsInProgress: Map<WorkspaceApiOperations, boolean>
constructor(private workspaceServer: WorkspaceServerInterface) {
this.operationsInProgress = new Map()
}
async createWorkspace(dto: {
encryptedWorkspaceKey: string
encryptedPrivateKey: string
publicKey: string
workspaceName?: string
}): Promise<WorkspaceCreationResponse> {
if (this.operationsInProgress.get(WorkspaceApiOperations.Creating)) {
throw new ApiCallError(ErrorMessage.GenericInProgress)
}
this.operationsInProgress.set(WorkspaceApiOperations.Creating, true)
try {
const response = await this.workspaceServer.createWorkspace({
encryptedPrivateKey: dto.encryptedPrivateKey,
encryptedWorkspaceKey: dto.encryptedWorkspaceKey,
publicKey: dto.publicKey,
workspaceName: dto.workspaceName,
})
this.operationsInProgress.set(WorkspaceApiOperations.Creating, false)
return response
} catch (error) {
throw new ApiCallError(ErrorMessage.GenericFail)
}
}
}
@@ -0,0 +1,10 @@
import { WorkspaceCreationResponse } from '../../Response'
export interface WorkspaceApiServiceInterface {
createWorkspace(dto: {
encryptedWorkspaceKey: string
encryptedPrivateKey: string
publicKey: string
workspaceName?: string
}): Promise<WorkspaceCreationResponse>
}
+2
View File
@@ -5,3 +5,5 @@ export * from './User/UserApiService'
export * from './User/UserApiServiceInterface'
export * from './WebSocket/WebSocketApiService'
export * from './WebSocket/WebSocketApiServiceInterface'
export * from './Workspace/WorkspaceApiService'
export * from './Workspace/WorkspaceApiServiceInterface'
@@ -5,5 +5,6 @@ export enum HttpStatusCode {
BadRequest = 400,
Unauthorized = 401,
Forbidden = 403,
Gone = 410,
ExpiredAccessToken = 498,
}
@@ -0,0 +1,7 @@
export type WorkspaceCreationRequestParams = {
encryptedWorkspaceKey: string
encryptedPrivateKey: string
publicKey: string
workspaceName?: string
[additionalParam: string]: unknown
}
+1
View File
@@ -6,3 +6,4 @@ export * from './Subscription/SubscriptionInviteListRequestParams'
export * from './Subscription/SubscriptionInviteRequestParams'
export * from './User/UserRegistrationRequestParams'
export * from './WebSocket/WebSocketConnectionTokenRequestParams'
export * from './Workspace/WorkspaceCreationRequestParams'
@@ -0,0 +1,9 @@
import { Either } from '@standardnotes/common'
import { HttpErrorResponseBody } from '../../Http/HttpErrorResponseBody'
import { HttpResponse } from '../../Http/HttpResponse'
import { WorkspaceCreationResponseBody } from './WorkspaceCreationResponseBody'
export interface WorkspaceCreationResponse extends HttpResponse {
data: Either<WorkspaceCreationResponseBody, HttpErrorResponseBody>
}
@@ -0,0 +1,3 @@
export type WorkspaceCreationResponseBody = {
uuid: string
}
@@ -12,3 +12,5 @@ export * from './User/UserRegistrationResponse'
export * from './User/UserRegistrationResponseBody'
export * from './WebSocket/WebSocketConnectionTokenResponse'
export * from './WebSocket/WebSocketConnectionTokenResponseBody'
export * from './Workspace/WorkspaceCreationResponse'
export * from './Workspace/WorkspaceCreationResponseBody'
@@ -0,0 +1,9 @@
const WorkspacePaths = {
createWorkspace: '/v1/workspaces',
}
export const Paths = {
v1: {
...WorkspacePaths,
},
}
@@ -0,0 +1,31 @@
import { HttpServiceInterface } from '../../Http'
import { WorkspaceCreationResponse } from '../../Response/Workspace/WorkspaceCreationResponse'
import { WorkspaceServer } from './WorkspaceServer'
describe('WorkspaceServer', () => {
let httpService: HttpServiceInterface
const createServer = () => new WorkspaceServer(httpService)
beforeEach(() => {
httpService = {} as jest.Mocked<HttpServiceInterface>
httpService.post = jest.fn().mockReturnValue({
data: { uuid: '1-2-3' },
} as jest.Mocked<WorkspaceCreationResponse>)
})
it('should create a workspace', async () => {
const response = await createServer().createWorkspace({
encryptedPrivateKey: 'foo',
encryptedWorkspaceKey: 'bar',
publicKey: 'buzz',
})
expect(response).toEqual({
data: {
uuid: '1-2-3',
},
})
})
})
@@ -0,0 +1,16 @@
import { HttpServiceInterface } from '../../Http/HttpServiceInterface'
import { WorkspaceCreationRequestParams } from '../../Request/Workspace/WorkspaceCreationRequestParams'
import { WorkspaceCreationResponse } from '../../Response/Workspace/WorkspaceCreationResponse'
import { Paths } from './Paths'
import { WorkspaceServerInterface } from './WorkspaceServerInterface'
export class WorkspaceServer implements WorkspaceServerInterface {
constructor(private httpService: HttpServiceInterface) {}
async createWorkspace(params: WorkspaceCreationRequestParams): Promise<WorkspaceCreationResponse> {
const response = await this.httpService.post(Paths.v1.createWorkspace, params)
return response as WorkspaceCreationResponse
}
}
@@ -0,0 +1,6 @@
import { WorkspaceCreationRequestParams } from '../../Request/Workspace/WorkspaceCreationRequestParams'
import { WorkspaceCreationResponse } from '../../Response/Workspace/WorkspaceCreationResponse'
export interface WorkspaceServerInterface {
createWorkspace(params: WorkspaceCreationRequestParams): Promise<WorkspaceCreationResponse>
}
+2
View File
@@ -4,3 +4,5 @@ export * from './User/UserServer'
export * from './User/UserServerInterface'
export * from './WebSocket/WebSocketServer'
export * from './WebSocket/WebSocketServerInterface'
export * from './Workspace/WorkspaceServer'
export * from './Workspace/WorkspaceServerInterface'
+8
View File
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [2.7.16](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-10-05)
**Note:** Version bump only for package @standardnotes/components-meta
## [2.7.15](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-10-05)
**Note:** Version bump only for package @standardnotes/components-meta
## [2.7.14](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-23)
**Note:** Version bump only for package @standardnotes/components-meta
-5
View File
@@ -13,11 +13,6 @@ exports.Components = void 0;
var BaseEditorStaticFiles = ['index.html', 'dist', 'package.json'];
var BaseThemeStaticFiles = ['dist', 'package.json'];
var Editors = [
{
identifier: 'org.standardnotes.advanced-checklist',
path: 'Editors/org.standardnotes.advanced-checklist',
static_files: __spreadArray(__spreadArray([], BaseEditorStaticFiles, true), ['build'], false),
},
{
identifier: 'org.standardnotes.code-editor',
path: 'Editors/org.standardnotes.code-editor',
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+6 -11
View File
@@ -70,9 +70,9 @@
"binary": "b621bfd81829a205f2f02e85d446e277ad20e367b92676ec20b3ee59b1bfab3f"
},
"org.standardnotes.markdown-visual-editor": {
"version": "1.1.2",
"base64": "2645d31c51fa6a198c14a32737ee4045dcbbecb8bdaa1432ca4686cab78834d2",
"binary": "c4479f8768f5f6cda41850212a8e03927990adfa33ebd36e29ee6de2335e8e46"
"version": "1.1.3",
"base64": "8bb35d66b0ef2bee2243dbdf514c0bf50ef706c034395cb9d50119f017fef9aa",
"binary": "1738193ab2a57cf280c29c9ca1e4caf49179009c7382048577d2b34eaf96d5e9"
},
"org.standardnotes.simple-task-editor": {
"version": "1.4.4",
@@ -80,20 +80,15 @@
"binary": "9df983a144b9686f4f58b03bf78bf1f84f53aea60251621a75586722bf576475"
},
"org.standardnotes.token-vault": {
"version": "2.2.4",
"base64": "fb004e8cae73b351fdb225ef910102a1b7c9b616b92de52f99d2c82d7b4dd5a1",
"binary": "9b00f950c868e20e059a5fe7dbd0dd14eac5d94b31817b8bf3c58c88ab5ce236"
"version": "2.2.5",
"base64": "ca103f730737d3a3046001666b626139692c08ab4dd5748b0290fdcb1b1eb04a",
"binary": "52f419cd60da00a2cad13fd357b50993c7694160fcca1c1bdf1859e3bdca3a2b"
},
"org.standardnotes.standard-sheets": {
"version": "1.5.1",
"base64": "0ae54799c28a336447a63ddabfe43d0c6e18f8c2cd29cfdb1c0174ab96fde248",
"binary": "54a01414a21e46c67fa59c69189a3d34a6548de7539699f2cf0248f9c5059d37"
},
"org.standardnotes.advanced-checklist": {
"version": "0.2.5",
"base64": "077a56ef75958105bc9dc16376bcea2e89aee57b512b43f9e1b33e1d32ea8358",
"binary": "e903a5c592bd03ca28d205d09dcbc7e4329c7cd57fb74b4e0e5fa724c2321a61"
},
"org.standardnotes.file-safe": {
"version": "2.0.16",
"base64": "2bb641344613fc86c340fb29636a68678a13e453d04fb36228af6045e06664db",
Binary file not shown.
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/components-meta",
"version": "2.7.14",
"version": "2.7.16",
"private": true,
"author": "Standard Notes.",
"main": "dist",
-5
View File
@@ -2,11 +2,6 @@ const BaseEditorStaticFiles = ['index.html', 'dist', 'package.json']
const BaseThemeStaticFiles = ['dist', 'package.json']
const Editors = [
{
identifier: 'org.standardnotes.advanced-checklist',
path: 'Editors/org.standardnotes.advanced-checklist',
static_files: [...BaseEditorStaticFiles, 'build'],
},
{
identifier: 'org.standardnotes.code-editor',
path: 'Editors/org.standardnotes.code-editor',
@@ -1,131 +0,0 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
*.lcov
# nyc test coverage
.nyc_output
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# TypeScript v1 declaration files
typings/
# TypeScript cache
*.tsbuildinfo
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
.env.test
# parcel-bundler cache (https://parceljs.org/)
.cache
# Next.js build output
.next
# Nuxt.js build / generate output
.nuxt
dist
# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and *not* Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public
# vuepress build output
.vuepress/dist
# Serverless directories
.serverless/
# FuseBox cache
.fusebox/
# DynamoDB Local files
.dynamodb/
# TernJS port file
.tern-port
#### Copied from Create React App ####
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
/node_modules
/.pnp
.pnp.js
# testing
/coverage
# production
/build
# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*
/public/ext.json
@@ -1,115 +0,0 @@
# Change Log
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [0.2.5](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-13)
**Note:** Version bump only for package @standardnotes/advanced-checklist
## [0.2.4](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-23)
**Note:** Version bump only for package @standardnotes/advanced-checklist
## [0.2.3](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-07-13)
### Bug Fixes
* upgrade jest with types to latest version ([09e08ca](https://github.com/standardnotes/app/commit/09e08ca899ba8694cf43292e918c4c204c0d2cb9))
* upgrade ts-jest in packages ([71e792d](https://github.com/standardnotes/app/commit/71e792da354ff90335b92758e196075a0f88d060))
## [0.2.2](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-07-06)
### Bug Fixes
* **advanced checklist:** improve editor styles ([#1221](https://github.com/standardnotes/app/issues/1221)) ([f7ba658](https://github.com/standardnotes/app/commit/f7ba6588a7d062e3ec82e6413042ce5d8cd075f7))
## [0.2.1](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-07-06)
**Note:** Version bump only for package @standardnotes/advanced-checklist
# [0.2.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-07-06)
### Features
* add utils package ([aef4ceb](https://github.com/standardnotes/app/commit/aef4ceb7f85948f1f08b8b09a4db5d187daa371b))
## [0.1.6](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-07-05)
### Bug Fixes
* **advanced checklist:** remove test for reorder icon ([#1209](https://github.com/standardnotes/app/issues/1209)) ([296aa9a](https://github.com/standardnotes/app/commit/296aa9aab2072d4aad68485c31c000ad2c3bf013))
## [0.1.5](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-07-05)
### Bug Fixes
* **advanced checklist:** UI changes ([#1208](https://github.com/standardnotes/app/issues/1208)) ([1ce4cb3](https://github.com/standardnotes/app/commit/1ce4cb3c5c8f4e590fd67fdbd684b36ac6383bd9))
## [0.1.4](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-07-04)
### Bug Fixes
* **advanced checklist:** animations and error handling ([#1200](https://github.com/standardnotes/app/issues/1200)) ([a0205a5](https://github.com/standardnotes/app/commit/a0205a5c7dd72184cb575195ced3132091072239))
## [0.1.3](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-06-30)
### Bug Fixes
* debounce saving task description/draft ([#1187](https://github.com/standardnotes/app/issues/1187)) ([47a0551](https://github.com/standardnotes/app/commit/47a0551967ca420a957e2123d56bd7f0c8a95c53))
## [0.1.2](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-06-29)
### Bug Fixes
* **advanced checklist:** style and layout improvements ([#1182](https://github.com/standardnotes/app/issues/1182)) ([6c19adb](https://github.com/standardnotes/app/commit/6c19adba1902ef054f501d57f6e284fbf44ca28b))
## [0.1.1](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-06-28)
**Note:** Version bump only for package @standardnotes/advanced-checklist
# [0.1.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-06-28)
### Features
* **advanced checklist:** collapsible group sections ([#1167](https://github.com/standardnotes/app/issues/1167)) ([59e5324](https://github.com/standardnotes/app/commit/59e5324a29029d024811bf2bb63e08ae42d3b62b))
* deprecated editors ([#1166](https://github.com/standardnotes/app/issues/1166)) ([60ca415](https://github.com/standardnotes/app/commit/60ca4150446f9a14bb6a31416686c6d07a7d0cd9))
* **web:** tailwind css ([#1147](https://github.com/standardnotes/app/issues/1147)) ([b80038f](https://github.com/standardnotes/app/commit/b80038f607d7411912fa99366abf559a44874ef3))
## [0.0.5](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-06-22)
**Note:** Version bump only for package @standardnotes/advanced-checklist
## [0.0.5-alpha.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-06-22)
### Bug Fixes
* components scripts ([#1136](https://github.com/standardnotes/app/issues/1136)) ([e80b4d0](https://github.com/standardnotes/app/commit/e80b4d0ffad495c758b593c30e1c4c754dda9b7e))
## 0.0.4 (2022-06-16)
**Note:** Version bump only for package @standardnotes/advanced-checklist
## 0.0.3 (2022-06-16)
**Note:** Version bump only for package @standardnotes/advanced-checklist
## [0.0.2](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-06-16)
**Note:** Version bump only for package @standardnotes/advanced-checklist
## [0.0.2-alpha.3](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-06-16)
**Note:** Version bump only for package @standardnotes/advanced-checklist
## 0.0.2-alpha.2 (2022-06-16)
**Note:** Version bump only for package @standardnotes/advanced-checklist
## 0.0.2-alpha.1 (2022-06-16)
**Note:** Version bump only for package @standardnotes/advanced-checklist
## 0.0.2-alpha.0 (2022-06-15)
**Note:** Version bump only for package @standardnotes/advanced-checklist
@@ -1,80 +0,0 @@
# advanced-checklist
A great way to manage short-term and long-term to-do's. You can mark tasks as completed, change their order, and edit the text naturally in place.
## Development
**Prerequisites:** Install [Node.js](https://nodejs.org/en/), [Yarn](https://classic.yarnpkg.com/en/docs/install/), and [Git](https://github.com/git-guides/install-git) on your computer.
The general instructions setting up an environment to develop Standard Notes extensions can be found [here](https://docs.standardnotes.org/extensions/local-setup). You can also follow these instructions:
1. Fork the [repository](https://github.com/standardnotes/advanced-checklist) on GitHub.
1. [Clone](https://help.github.com/en/github/creating-cloning-and-archiving-repositories/cloning-a-repository) your fork of the repository.
1. Run `cd advanced-checklist` to enter the `advanced-checklist` directory.
1. Run `yarn install` to install the dependencies on your machine as they are described in `yarn.lock`.
### Testing in the browser
1. To run the app in development mode, run `yarn start` and visit http://localhost:8001. Press `ctrl/cmd + C` to exit development mode.
### Testing in the Standard Notes app
1. Create an `ext.json` in the `public` directory. You have three options:
1. Use `sample.ext.json`.
1. Create `ext.json` as a copy of `sample.ext.json`.
1. Follow the instructions [here](https://docs.standardnotes.org/extensions/local-setup) with `url: "http://localhost:3000/index.html"`.
1. Install http-server using `sudo npm install -g http-server` then run `yarn server` to serve the `./build` directory at http://localhost:3000.
1. To build the app, run `yarn build`.
1. Install the editor into the [web](https://app.standardnotes.org) or [desktop](https://standardnotes.org/download) app with `http://localhost:3000/sample.ext.json` or with your custom `ext.json`. Press `ctrl/cmd + C` to shut down the server.
### Deployment
1. To make the source code prettier, run `yarn pretty`.
1. To the deploy the build into the `gh-pages` branch of your repository on GitHub, run `yarn deploy-stable`.
1. To deploy the build into to the `dev` branch for testing, run `yarn deploy-dev`.
1. To deploy the built into the `build` branch for distributing, run `yarn deploy-build` for distributing builds.
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
### Available Scripts
In the project directory, you can run:
#### `yarn start`
Runs the app in the development mode.\
Open [http://localhost:8001](http://localhost:8001) to view it in the browser.
The page will reload if you make edits.\
You will also see any lint errors in the console.
#### `yarn test`
Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
#### `yarn build`
Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
#### `yarn eject`
**Note: this is a one-way operation. Once you `eject`, you cant go back!**
If you arent satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point youre on your own.
You dont have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldnt feel obligated to use this feature. However we understand that this tool wouldnt be useful if you couldnt customize it when you are ready for it.
### Learn More
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
To learn React, check out the [React documentation](https://reactjs.org/).
@@ -1,2 +0,0 @@
const override = require('../cra-app.override')
module.exports = override
@@ -1,127 +0,0 @@
{
"name": "@standardnotes/advanced-checklist",
"version": "0.2.5",
"description": "A task editor with grouping functionality.",
"author": "Standard Notes.",
"keywords": [
"Standard Notes",
"Standard Notes Extensions"
],
"private": true,
"license": "AGPL-3.0-or-later",
"sn": {
"main": "build/index.html"
},
"homepage": ".",
"scripts": {
"analyze": "source-map-explorer 'build/static/js/*.js'",
"start": "react-app-rewired start",
"test:coverage": "npm run test -- --coverage --watchAll --no-silent",
"eject": "react-scripts eject",
"components:compile": "react-app-rewired build",
"test": "react-app-rewired test --watchAll=false --silent",
"format": "prettier --write 'src/**/*.{html,css,scss,js,jsx,ts,tsx,json}' README.md"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"lint-staged": {
"README.md": [
"prettier --write"
],
"src/**/*.{js,jsx,ts,tsx,json,css,scss,md}": [
"prettier --write"
]
},
"jest": {
"collectCoverageFrom": [
"src/**/*.{js,jsx,ts,tsx}",
"!<rootDir>/node_modules/"
],
"coveragePathIgnorePatterns": [
"<rootDir>/src/mockData.ts",
"<rootDir>/src/app/hooks.ts",
"<rootDir>/src/app/store.ts",
"<rootDir>/src/app/listenerMiddleware.ts"
],
"coverageReporters": [
"text",
"html"
],
"coverageThreshold": {
"global": {
"branches": 90,
"functions": 100,
"lines": 100,
"statements": 100
}
},
"transform": {
"^.+\\.(ts|tsx)$": "ts-jest"
},
"transformIgnorePatterns": [
"[/\\\\]node_modules[/\\\\].+\\.(js|jsx|ts|tsx)$",
"^.+\\.module\\.(css|sass|scss)$"
]
},
"dependencies": {
"@standardnotes/utils": "workspace:*"
},
"devDependencies": {
"@reach/alert-dialog": "0.16.2",
"@reach/menu-button": "0.16.2",
"@reach/visually-hidden": "0.16.0",
"@react-hook/resize-observer": "^1.2.5",
"@reduxjs/toolkit": "1.8.0",
"@standardnotes/editor-kit": "2.2.5",
"@standardnotes/stylekit": "5.23.0",
"@testing-library/dom": "8.11.3",
"@testing-library/jest-dom": "5.16.2",
"@testing-library/react": "12.1.4",
"@testing-library/user-event": "13.5.0",
"@types/jest": "^28.1.5",
"@types/lodash": "4.14.179",
"@types/node": "17.0.21",
"@types/react": "17.0.40",
"@types/react-beautiful-dnd": "13.1.2",
"@types/react-dom": "17.0.13",
"@types/react-redux": "7.1.23",
"@types/react-transition-group": "4.4.4",
"@types/redux-mock-store": "1.0.3",
"@types/styled-components": "5.1.24",
"@types/uuid": "8.3.4",
"gh-pages": "3.2.3",
"lint-staged": "12.3.5",
"node-sass": "*",
"prettier": "*",
"react": "17.0.2",
"react-app-rewired": "^2.2.1",
"react-beautiful-dnd": "13.1.0",
"react-dom": "17.0.2",
"react-redux": "7.2.8",
"react-scripts": "5.0.0",
"react-transition-group": "4.4.2",
"redux": "4.1.2",
"redux-mock-store": "1.5.4",
"source-map-explorer": "2.5.2",
"styled-components": "5.3.5",
"ts-jest": "^28.0.5",
"typescript": "4.6.2",
"uuid": "8.3.2"
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

@@ -1,44 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="A great way to manage short-term and long-term to-do's. You can mark tasks as completed, change their order, and edit the text naturally in place."
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>Advanced Checklist</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div class="sn-component" id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.4 KiB

@@ -1,25 +0,0 @@
{
"short_name": "Advanced Checklist",
"name": "Advanced Checklist",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "logo192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "logo512.png",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
@@ -1,3 +0,0 @@
# https://www.robotstxt.org/robotstxt.html
User-agent: *
Disallow:
@@ -1,12 +0,0 @@
{
"identifier": "org.standardnotes.advanced-checklist-dev",
"name": "Advanced Checklist - Dev",
"content_type": "SN|Component",
"area": "editor-editor",
"version": "0.1.0",
"description": "A task editor with grouping functionality.",
"url": "http://localhost:3000/index.html",
"download_url": "",
"latest_url": "",
"thumbnail_url": ""
}
@@ -1,54 +0,0 @@
import useResizeObserver from '@react-hook/resize-observer'
import React, { useEffect, useRef, useState } from 'react'
import { TypedUseSelectorHook, useDispatch, useSelector } from 'react-redux'
import type { AppDispatch, RootState } from './store'
export const useAppDispatch = () => useDispatch<AppDispatch>()
export const useAppSelector: TypedUseSelectorHook<RootState> = useSelector
export const useDidMount = (effect: React.EffectCallback, deps?: React.DependencyList) => {
const [didMount, setDidMount] = useState(false)
useEffect(() => {
if (didMount) {
effect()
} else {
setDidMount(true)
}
}, [deps, didMount, effect])
}
export const useResize = (ref: React.RefObject<HTMLElement>, effect: (target: HTMLElement) => void) => {
const [size, setSize] = useState<DOMRect>()
function isDeepEqual(prevSize?: DOMRect, nextSize?: DOMRect) {
return JSON.stringify(prevSize) === JSON.stringify(nextSize)
}
useResizeObserver(ref, ({ contentRect, target }) => {
if (!isDeepEqual(size, contentRect)) {
setSize(contentRect)
effect(target as HTMLElement)
}
})
}
export const useDebouncedCallback = (callback: () => void, waitMs: number = 500) => {
const timeout = useRef<any>()
clearTimeout(timeout.current)
timeout.current = setTimeout(() => {
callback()
}, waitMs)
}
export const usePrevious = (value: any) => {
const ref = useRef<typeof value>()
useEffect(() => {
ref.current = value
}, [value])
return ref.current
}
@@ -1,46 +0,0 @@
import { createListenerMiddleware, isAnyOf } from '@reduxjs/toolkit'
import {
deleteAllCompleted,
openAllCompleted,
taskAdded,
taskDeleted,
taskModified,
tasksGroupAdded,
tasksGroupCollapsed,
tasksGroupDeleted,
tasksGroupLastActive,
tasksGroupMerged,
tasksReordered,
taskToggled,
} from '../features/tasks/tasks-slice'
const listenerMiddleware = createListenerMiddleware()
/**
* A list of actions that we want to listen to.
* The groupName is obtained from the payload, and we use it to
* dispatch the tasksGroupLastActive action.
*/
const actionsWithGroup = isAnyOf(
taskAdded,
taskModified,
taskToggled,
taskDeleted,
openAllCompleted,
deleteAllCompleted,
tasksReordered,
tasksGroupAdded,
tasksGroupDeleted,
tasksGroupMerged,
tasksGroupCollapsed,
)
listenerMiddleware.startListening({
matcher: actionsWithGroup,
effect: ({ payload }, listenerApi) => {
const { groupName } = payload
listenerApi.dispatch(tasksGroupLastActive({ groupName }))
},
})
export default listenerMiddleware.middleware
@@ -1,16 +0,0 @@
import { configureStore } from '@reduxjs/toolkit'
import settingsReducer from '../features/settings/settings-slice'
import tasksReducer from '../features/tasks/tasks-slice'
import listenerMiddleware from './listenerMiddleware'
export const store = configureStore({
reducer: {
tasks: tasksReducer,
settings: settingsReducer,
},
middleware: (getDefaultMiddleware) => getDefaultMiddleware().prepend(listenerMiddleware),
})
export type AppDispatch = typeof store.dispatch
export type RootState = ReturnType<typeof store.getState>
@@ -1,38 +0,0 @@
import { ChangeEvent, forwardRef, MouseEvent } from 'react'
type CheckBoxInputProps = {
checked?: boolean
disabled?: boolean
testId?: string
onChange?: (event: ChangeEvent<HTMLInputElement>) => void
onClick?: (event: MouseEvent<SVGElement>) => void
}
export const CheckBoxInput = forwardRef<HTMLInputElement, CheckBoxInputProps>(
({ checked, disabled, testId, onChange, onClick }, ref) => {
return (
<label className="checkbox-container">
<input
className="checkbox-state"
type="checkbox"
checked={checked}
data-testid={testId}
disabled={disabled}
onChange={onChange}
ref={ref}
/>
<svg
xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
viewBox="3 2 22 20"
className="checkbox-button"
onClick={onClick}
>
<use xlinkHref="#checkbox-square" className="checkbox-square"></use>
<use xlinkHref="#checkbox-mark" className="checkbox-mark"></use>
<use xlinkHref="#checkbox-circle" className="checkbox-circle"></use>
</svg>
</label>
)
},
)
@@ -1,48 +0,0 @@
import React, { useEffect, useState } from 'react'
import styled from 'styled-components'
const ProgressBarBackground = styled.circle`
fill: none;
stroke: var(--sn-stylekit-neutral-color);
`
const ProgressBarStroke = styled.circle`
fill: none;
stroke: var(--sn-stylekit-info-color);
transition: all 0.5s;
`
type CircularProgressBarProps = {
size: number
percentage: number
}
export const CircularProgressBar: React.FC<CircularProgressBarProps> = ({ size, percentage }) => {
const [progress, setProgress] = useState(0)
useEffect(() => {
setProgress(percentage)
}, [percentage])
const viewBox = `0 0 ${size} ${size}`
const strokeWidth = size * (0.1 / 100) * 100 + 1
const radius = (size - strokeWidth) / 2
const circumference = radius * Math.PI * 2
const dash = (progress * circumference) / 100
return (
<svg height={size} viewBox={viewBox} width={size} data-testid="circular-progress-bar">
<ProgressBarBackground cx={size / 2} cy={size / 2} r={radius} strokeWidth={strokeWidth} />
<ProgressBarStroke
cx={size / 2}
cy={size / 2}
r={radius}
strokeWidth={strokeWidth}
transform={`rotate(-90 ${size / 2} ${size / 2})`}
strokeDasharray={`${dash} ${circumference - dash}`}
strokeLinecap="round"
style={{ transition: 'all 0.5s' }}
/>
</svg>
)
}

Some files were not shown because too many files have changed in this diff Show More