Skip to content

Commit

Permalink
Merge branch 'release/3.1.0' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
blackforestboi committed Jan 1, 2022
2 parents b7139c0 + 19ef79b commit 52a016a
Show file tree
Hide file tree
Showing 89 changed files with 2,648 additions and 666 deletions.
2 changes: 1 addition & 1 deletion external/@worldbrain/storex
Submodule storex updated 2 files
+1 −1 ts/types/backend.ts
+3 −1 ts/utils.ts
1 change: 1 addition & 0 deletions img/arrow-up.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions img/compress-alt.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 5 additions & 3 deletions img/doubleArrow.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions img/expand-alt.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions img/thumbtack.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "worldbrain-extension",
"version": "3.0.11",
"version": "3.1.0",
"homepage": "https://worldbrain.io",
"repository": "https://github.com/WorldBrain/Memex",
"scripts": {
Expand Down Expand Up @@ -121,6 +121,7 @@
"react-markdown": "^5.0.0",
"react-onclickoutside": "^6.7.1",
"react-redux": "^5.0.7",
"react-rnd": "^10.3.5",
"react-router": "^3.2.1",
"react-shadow-dom-retarget-events": "^1.0.8",
"react-string-replace": "^0.4.4",
Expand Down
17 changes: 15 additions & 2 deletions src/annotations/annotation-save-logic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export async function createAnnotation({
await copyToClipboard(getNoteShareUrl({ remoteAnnotationId }))
}
}

return {
remoteAnnotationLink: shareOpts?.shouldShare
? getNoteShareUrl({ remoteAnnotationId })
Expand All @@ -68,7 +69,13 @@ export async function createAnnotation({
pageUrl: annotationData.fullPageUrl,
selector: annotationData.selector,
title: annotationData.pageTitle,
comment: annotationData.comment,
comment: annotationData.comment
.replace(/\\\[/g, '[')
.replace(/\\\]/g, ']')
.replace(/\\\(/g, '(')
.replace(/\\\)/g, ')')
.replace(/\ \n/g, '')
.replace(/\* /g, ' * '),
body: annotationData.body,
},
{ skipPageIndexing },
Expand Down Expand Up @@ -123,7 +130,13 @@ export async function updateAnnotation({
savePromise: (async () => {
await annotationsBG.editAnnotation(
annotationData.localId,
annotationData.comment,
annotationData.comment
.replace(/\\\[/g, '[')
.replace(/\\\]/g, ']')
.replace(/\\\(/g, '(')
.replace(/\\\)/g, ')')
.replace(/\ \n/g, '')
.replace(/\* /g, ' * '),
)

await Promise.all([
Expand Down
1 change: 1 addition & 0 deletions src/annotations/components/AnnotationCreate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ export class AnnotationCreate extends React.Component<Props, State>
: 'initial'
}
height="430px"
overflow="scroll"
>
<QuickTutorial
markdownHelpOnTop={true}
Expand Down
1 change: 1 addition & 0 deletions src/annotations/components/AnnotationEdit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ class AnnotationEdit extends React.Component<Props> {
}
markdownContent={this.props.comment}
onKeyDown={this.handleInputKeyDown}
placeholder={`Add Note. Click on ( ? ) for formatting help.`}
/>
</EditorContainer>
)
Expand Down
10 changes: 7 additions & 3 deletions src/annotations/components/AnnotationEditable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ export default class AnnotationEditable extends React.Component<Props> {

return (
<ThemeProvider theme={this.theme}>
<Margin top="10px">
<Margin top="5px">
<ItemBox
firstDivProps={{
id: this.props.url,
Expand Down Expand Up @@ -542,6 +542,7 @@ export default class AnnotationEditable extends React.Component<Props> {
: 'initial'
}
height="430px"
overflow="scroll"
>
<QuickTutorial
markdownHelpOnTop={true}
Expand Down Expand Up @@ -787,9 +788,11 @@ const ContentContainer = styled.div`
const DeleteConfirmStyled = styled.span`
box-sizing: border-box;
font-weight: 800;
font-size: 15px;
font-size: 14px;
color: #000;
margin-right: 5px;
margin-right: 10px;
width: 100%;
text-align: right;
`

const CancelBtnStyled = styled.button`
Expand Down Expand Up @@ -849,6 +852,7 @@ const ActionBtnStyled = styled.button`
const DeletionBox = styled.div`
display: flex;
justify-content: space-between;
align-items: center;
border-top: 1px solid #f0f0f0;
padding: 5px;
}
Expand Down
2 changes: 1 addition & 1 deletion src/annotations/components/save-btn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export default class AnnotationSaveBtn extends React.PureComponent<
</SaveBtnText>
<SaveBtnArrow horizontal="1px">
<DropdownMenuBtn
btnChildren={<Icon icon="triangle" height="8px" />}
btnChildren={<Icon icon="triangle" height="12px" />}
isOpen={this.state.isPrivacyLevelShown}
toggleOpen={() =>
this.setState((state) => ({
Expand Down
2 changes: 1 addition & 1 deletion src/background-script/quick-and-dirty-migrations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ export const migrations: Migrations = {
'reseed-collections-suggestion-cache': async ({ localStorage, db }) => {
const cacheStorageKey = 'custom-lists_suggestions'

const listEntries = await db.table('customLists').limit(10).toArray()
const listEntries = await db.table('customLists').limit(1000).toArray()
const newCache: string[] = listEntries.map((entry) => entry.name)

await localStorage.set({ [cacheStorageKey]: newCache })
Expand Down
9 changes: 7 additions & 2 deletions src/background-script/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ import type { ReadwiseSettings } from 'src/readwise-integration/background/types
import type { LocalExtensionSettings } from './types'
import { normalizeUrl } from '@worldbrain/memex-url-utils/lib/normalize/utils'
import { createSyncSettingsStore } from 'src/sync-settings/util'
import { runCloudIntegrationSideEffects } from 'src/personal-cloud/background/integration-side-effects'

export interface BackgroundModules {
auth: AuthBackground
Expand Down Expand Up @@ -224,7 +225,6 @@ export function createBackgroundModules(options: {
createInboxEntry,
tabManagement,
getNow,
generateServerId,
})
tabManagement.events.on('tabRemoved', (event) => {
pages.handleTabClose(event)
Expand Down Expand Up @@ -539,7 +539,7 @@ export function createBackgroundModules(options: {
: options.storageManager

// WARNING: Keep in mind this skips all storage middleware
await updateOrCreate({
const { opPerformed } = await updateOrCreate({
...params,
storageManager: incomingStorageManager,
executeOperation: (...args: any[]) => {
Expand Down Expand Up @@ -576,7 +576,12 @@ export function createBackgroundModules(options: {
{ text: processed },
)
}

return { opPerformed }
},
runIntegrationSideEffects: runCloudIntegrationSideEffects({
customLists,
}),
getServerStorageManager,
})
options.services.contentSharing.preKeyGeneration = async (params) => {
Expand Down
10 changes: 10 additions & 0 deletions src/common-ui/GenericPicker/components/EntryResultsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ interface Props {
renderEntryRow: (list: DisplayEntry, index: number) => ReactNode
emptyView?: ReactNode
id: string
query?: string
}

export default class EntryResultsList extends React.Component<Props> {
Expand All @@ -23,6 +24,9 @@ export default class EntryResultsList extends React.Component<Props> {
render = () => {
return (
<StyledContainer id={this.props.id}>
{this.props.query === '' && (
<RecentItemsNotif>Recently used</RecentItemsNotif>
)}
{/*<FilterHelp>
Select lists to include
<Check size={18} /> or exclude
Expand All @@ -35,6 +39,12 @@ export default class EntryResultsList extends React.Component<Props> {
}
}

const RecentItemsNotif = styled.div`
padding: 5px 10px;
font-size: 12px;
color: ${(props) => props.theme.colors.subText};
`

const StyledContainer = styled.div`
overflow-y: auto;
max-height: 280px;
Expand Down
20 changes: 2 additions & 18 deletions src/common-ui/GenericPicker/logic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,7 @@ export default abstract class GenericPickerLogic<
}

getInitialState(): State {
return {
...INITIAL_STATE,
selectedEntries: [],
displayEntries: [],
} as State
return INITIAL_STATE as State
}

async init() {
Expand Down Expand Up @@ -263,7 +259,7 @@ export default abstract class GenericPickerLogic<
displayEntries: DisplayEntry[],
term: string,
) => {
if (this._isTermInEntryList(list, term)) {
if (list.includes(term)) {
this.emitMutation({
$apply: (state) => ({
...state,
Expand Down Expand Up @@ -315,18 +311,6 @@ export default abstract class GenericPickerLogic<
})
}

/**
* Loops through a list of entries and exits if a match is found
*/
_isTermInEntryList = (entryList: string[], term: string) => {
for (const entry of entryList) {
if (entry === term) {
return true
}
}
return false
}

_queryInitialSuggestions = (term) =>
this.defaultEntries.filter((entry) => entry.name.includes(term))

Expand Down
7 changes: 5 additions & 2 deletions src/common-ui/components/design-library/HoverBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ export interface Props {
withRelativeContainer?: boolean
position?: string
height?: string
overflow?: string
}

export class HoverBox extends React.Component<Props> {
render() {
console.log(this.props.overflow)
if (!this.props.withRelativeContainer) {
return (
<HoverBoxDiv {...this.props}>{this.props.children}</HoverBoxDiv>
Expand All @@ -28,14 +30,15 @@ export class HoverBox extends React.Component<Props> {
}
}

export const HoverBoxContainer = styled.div`
export const HoverBoxContainer = styled.div<Props>`
position: relative;
overflow: ${(props) => (props.overflow ? props.overflow : 'visible')};
`

export const HoverBoxDiv = styled.div<Props>`
box-shadow: rgba(15, 15, 15, 0.05) 0px 0px 0px 1px,
rgba(15, 15, 15, 0.1) 0px 3px 6px, rgba(15, 15, 15, 0.2) 0px 9px 24px;
overflow: visible;
overflow: ${(props) => (props.overflow ? props.overflow : 'visible')};;
position: ${(props) => (props.position ? props.position : 'absolute')};;
border-radius: 3px;
width: ${(props) => (props.width ? props.width : '300px')};
Expand Down
8 changes: 8 additions & 0 deletions src/common-ui/components/design-library/icons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export const settings = browser.extension.getURL('/img/settings.svg')

export const check = browser.runtime.getURL('/img/check.svg')
export const checkRound = browser.runtime.getURL('/img/checkRound.svg')
export const highlighterFull = browser.runtime.getURL('/img/highlightOn.svg')
export const alertRound = browser.runtime.getURL('/img/alertRound.svg')
export const close = browser.runtime.getURL('/img/close.svg')
export const tagFull = browser.runtime.getURL('/img/tag_full.svg')
Expand All @@ -23,6 +24,8 @@ export const helpIcon = browser.runtime.getURL('/img/help.svg')
export const searchIcon = browser.runtime.getURL('/img/search.svg')
export const commentAdd = browser.runtime.getURL('/img/comment_add.svg')
export const commentEdit = browser.runtime.getURL('/img/comment_edit.svg')
export const compress = browser.runtime.getURL('/img/compress-alt.svg')
export const expand = browser.runtime.getURL('/img/expand-alt.svg')
export const commentEditFull = browser.runtime.getURL(
'/img/comment_edit_full.svg',
)
Expand All @@ -39,10 +42,12 @@ export const plus = browser.runtime.getURL('/img/plus.svg')
export const dots = browser.runtime.getURL('/img/3dots.svg')
export const trash = browser.runtime.getURL('/img/trash.svg')
export const goTo = browser.runtime.getURL('/img/open.svg')
export const openSidebar = browser.runtime.getURL('/img/openSidebar.svg')
export const copy = browser.runtime.getURL('/img/copy.svg')
export const edit = browser.runtime.getURL('/img/edit.svg')
export const remove = browser.runtime.getURL('/img/remove.svg')
export const removeX = browser.runtime.getURL('/img/removeX.svg')
export const pin = browser.runtime.getURL('/img/thumbtack.svg')
export const share = browser.runtime.getURL('/img/share.svg')
export const shareWhite = browser.runtime.getURL('/img/shareWhite.svg')
export const shareEmpty = browser.runtime.getURL('/img/shareEmpty.svg')
Expand All @@ -53,6 +58,9 @@ export const shared = browser.runtime.getURL('/img/shared.svg')
export const sharedProtected = browser.runtime.getURL(
'/img/sharedprotected.svg',
)

export const arrowUp = browser.runtime.getURL('/img/arrow-up.svg')

export const saveIcon = browser.runtime.getURL('/img/saveIcon.svg')
export const addPeople = browser.runtime.getURL('/img/addPeople.svg')

Expand Down
2 changes: 1 addition & 1 deletion src/common-ui/components/design-library/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export const theme: Theme = {
smallText: '12px',
},
zIndices: {
overlay: 50,
overlay: 5000,
},
icons: {
copy: icons.copy,
Expand Down
3 changes: 2 additions & 1 deletion src/common-ui/components/dropdown-menu-btn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,6 @@ const MenuBtn = styled.div<{ isOpen: boolean }>`

const Menu = styled.ul`
position: absolute;
${({ theme }) => `left: ${theme.leftMenuOffset ?? 0};`}
width: max-content;
list-style: none;
padding: 5px 0;
Expand All @@ -271,4 +270,6 @@ const Menu = styled.ul`
margin-top: 5px;
flex-direction: column;
top: 25px;
left: -65px;
z-index: 1000;
`
Loading

0 comments on commit 52a016a

Please sign in to comment.