Skip to content

Commit

Permalink
merged main
Browse files Browse the repository at this point in the history
  • Loading branch information
fb929 committed Nov 26, 2024
2 parents 5146e9b + 7df55f0 commit 9841676
Show file tree
Hide file tree
Showing 342 changed files with 12,339 additions and 8,617 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
matrix:
os:
- macos-12
- macos-13
- ubuntu-latest
- windows-latest

Expand Down Expand Up @@ -96,7 +96,7 @@ jobs:
CGO_ENABLED: 0

- name: Build Front Mac OS
if: matrix.os == 'macos-12'
if: matrix.os == 'macos-13'
uses: samuelmeuli/action-electron-builder@v1
with:
github_token: ${{secrets.TOKEN}}
Expand All @@ -113,7 +113,7 @@ jobs:
SENTRY_AUTH_TOKEN: ${{secrets.SENTRY_AUTH_TOKEN}}

- name: Build Front Other
if: matrix.os != 'macos-12'
if: matrix.os != 'macos-13'
uses: samuelmeuli/action-electron-builder@v1
with:
github_token: ${{secrets.TOKEN}}
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,16 @@ docs/*
electron/env.json
src/json/schema
licenses.json
dist/.rsdoctor

# generated by rspack
/compilation-stats.json

# generated by update.sh
/linux-amd*/
/linux-arm*/
/darwin-amd*/
/darwin-arm*/
/windows/
.aider*
.env
3 changes: 2 additions & 1 deletion dist/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ nmh.log
extension.crx
extension.pem
extension.zip
cmaps/*
cmaps/*
bundle-back.js.map
1 change: 1 addition & 0 deletions dist/extension/css/foreground.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#anytypeWebclipper-iframe {
position: absolute; z-index: 1; width: 50%; height: 80%; background: #fff; left: 50%; top: 50%; transform: translate3d(-50%,-50%,0px);
border-radius: 16px; border: 1px solid rgba(172, 169, 152, 0.12); box-shadow: 0px 4px 20px 0px rgba(0, 0, 0, 0.10);
min-width: 600px;
}

#anytypeWebclipper-container .dimmer {
Expand Down
2 changes: 1 addition & 1 deletion dist/extension/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version": 3,
"name": "Anytype Web Clipper",
"description": "Save web content to the Anytype — open, encrypted, and local-first application that connects everything as objects.",
"version": "0.0.5",
"version": "0.0.7",
"icons": {
"16": "img/icon16x16.png",
"128": "img/icon128x128.png"
Expand Down
Binary file modified dist/img/help/notion/1-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified dist/img/help/notion/1-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified dist/img/help/notion/1-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified dist/img/help/notion/1-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified dist/img/help/notion/1-5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified dist/img/help/notion/1-6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
2 changes: 1 addition & 1 deletion electron/js/lib/installNativeMessagingHost.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const { fixPathForAsarUnpack, is } = require('electron-util');

const APP_NAME = 'com.anytype.desktop-dev';
const MANIFEST_FILENAME = `${APP_NAME}.json`;
const EXTENSION_IDS = [ 'jbnammhjiplhpjfncnlejjjejghimdkf', 'jkmhmgghdjjbafmkgjmplhemjjnkligf' ];
const EXTENSION_IDS = [ 'jbnammhjiplhpjfncnlejjjejghimdkf', 'jkmhmgghdjjbafmkgjmplhemjjnkligf', 'lcamkcmpcofgmbmloefimnelnjpcdpfn' ];
const USER_PATH = app.getPath('userData');
const EXE_PATH = app.getPath('exe');

Expand Down
12 changes: 7 additions & 5 deletions electron/js/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ const { is } = require('electron-util');
const path = require('path');
const ConfigManager = require('./config.js');
const Util = require('./util.js');

const Separator = { type: 'separator' };

class MenuManager {
Expand All @@ -21,6 +20,7 @@ class MenuManager {
const Api = require('./api.js');
const WindowManager = require('./window.js');
const UpdateManager = require('./update.js');
const isAllowedUpdate = UpdateManager.isAllowed();

config.debug = config.debug || {};
config.flagsMw = config.flagsMw || {};
Expand All @@ -37,9 +37,8 @@ class MenuManager {
{ role: 'hideothers', label: Util.translate('electronMenuHideOthers') },
{ role: 'unhide', label: Util.translate('electronMenuUnhide') },

Separator,

{ label: Util.translate('electronMenuCheckUpdates'), click: () => Api.updateCheck(this.win) },
{ type: 'separator', visible: isAllowedUpdate },
{ label: Util.translate('electronMenuCheckUpdates'), click: () => Api.updateCheck(this.win), visible: isAllowedUpdate },

Separator,

Expand Down Expand Up @@ -235,6 +234,7 @@ class MenuManager {
{ label: Util.translate('electronMenuDebugProcess'), click: () => Util.send(this.win, 'commandGlobal', 'debugProcess') },
{ label: Util.translate('electronMenuDebugStat'), click: () => Util.send(this.win, 'commandGlobal', 'debugStat') },
{ label: Util.translate('electronMenuDebugReconcile'), click: () => Util.send(this.win, 'commandGlobal', 'debugReconcile') },
{ label: Util.translate('electronMenuDebugNet'), click: () => Util.send(this.win, 'commandGlobal', 'debugNet') },

Separator,

Expand Down Expand Up @@ -307,6 +307,8 @@ class MenuManager {
const { config } = ConfigManager;
const WindowManager = require('./window.js');
const Api = require('./api.js');
const UpdateManager = require('./update.js');
const isAllowedUpdate = UpdateManager.isAllowed();

this.destroy();

Expand All @@ -325,7 +327,7 @@ class MenuManager {

Separator,

{ label: Util.translate('electronMenuCheckUpdates'), click: () => { this.winShow(); Api.updateCheck(this.win); } },
{ label: Util.translate('electronMenuCheckUpdates'), click: () => { this.winShow(); Api.updateCheck(this.win); }, visible: isAllowedUpdate },
{ label: Util.translate('commonSettings'), submenu: this.menuSettings() },

Separator,
Expand Down
4 changes: 2 additions & 2 deletions electron/js/preload.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ contextBridge.exposeInMainWorld('Electron', {
userPath: () => app.getPath('userData'),
tmpPath,
logPath: () => path.join(app.getPath('userData'), 'logs'),
filePath: (...args) => path.join(...args),
dirName: fp => path.dirname(fp),
filePath: (...args) => path.join(...args),
fileName: fp => path.basename(fp),
fileMime: fp => mime.lookup(fp),
fileExt: fp => path.extname(fp).replace(/^./, ''),
Expand All @@ -39,7 +39,7 @@ contextBridge.exposeInMainWorld('Electron', {
getGlobal: key => getGlobal(key),
showOpenDialog: dialog.showOpenDialog,

webFilePath: file => webUtils.getPathForFile(file),
webFilePath: file => webUtils && webUtils.getPathForFile(file),

fileWrite: (name, data, options) => {
name = String(name || 'temp');
Expand Down
4 changes: 4 additions & 0 deletions electron/js/update.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ class UpdateManager {
return false;
};

if (is.macos && (major <= 10)) {
return false;
};

return true;
};

Expand Down
5 changes: 3 additions & 2 deletions electron/js/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ const protocol = 'anytype';
const ConfigManager = require('./config.js');
const Constant = require('../json/constant.json');

log.transports.rendererConsole.level = 'error';
log.initialize();
log.transports.console.level = 'error';

class Util {

Expand Down Expand Up @@ -240,4 +241,4 @@ class Util {

};

module.exports = new Util();
module.exports = new Util();
7 changes: 3 additions & 4 deletions extension/iframe/create.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const Create = observer(class Create extends React.Component<I.PageComponent, St

return (
<div ref={ref => this.node = ref} className="page pageCreate">
{isLoading ? <Loader type="loader" /> : ''}
{isLoading ? <Loader type={I.LoaderType.Loader} /> : ''}

<div className="head">
<div className="side left">
Expand All @@ -56,7 +56,7 @@ const Create = observer(class Create extends React.Component<I.PageComponent, St
}}
/>

<div id="select" className="select" onMouseDown={this.onSelect}>
<div id="select-object" className="select" onMouseDown={this.onSelect}>
<div className="item">
{object ? <IconObject object={object} iconSize={16} /> : ''}
<div className="name">{object ? object.name : translate('commonSelectObject')}</div>
Expand Down Expand Up @@ -95,7 +95,6 @@ const Create = observer(class Create extends React.Component<I.PageComponent, St

componentDidUpdate (): void {
this.initBlocks();

};

init () {
Expand Down Expand Up @@ -159,7 +158,7 @@ const Create = observer(class Create extends React.Component<I.PageComponent, St
];

S.Menu.open('searchObject', {
element: node.find('#select'),
element: node.find('#select-object'),
data: {
value: object ? [ object.id ] : [],
canAdd: true,
Expand Down
20 changes: 12 additions & 8 deletions extension/lib/util.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { S, U, J, dispatcher } from 'Lib';
import { S, U, J, C, dispatcher } from 'Lib';

const INDEX_POPUP = '/popup/index.html';
const INDEX_IFRAME = '/iframe/index.html'
Expand Down Expand Up @@ -56,13 +56,17 @@ class Util {
return;
};

if (message.accountId) {
S.Auth.accountSet({ id: message.accountId });
};

if (onSuccess) {
onSuccess();
};
C.AccountSelect(message.accountId, '', 0, '', (message: any) => {
S.Auth.accountSet(message.account);
S.Common.configSet(message.account.config, false);
S.Common.showVaultSet(false);

U.Data.onInfo(message.account.info);

if (onSuccess) {
onSuccess();
};
});
});
};

Expand Down
16 changes: 4 additions & 12 deletions extension/popup/create.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const Create = observer(class Create extends React.Component<I.PageComponent, St
ref={ref => this.node = ref}
className="page pageCreate"
>
{isLoading ? <Loader type="loader" /> : ''}
{isLoading ? <Loader type={I.LoaderType.Loader} /> : ''}

<form onSubmit={this.onSubmit}>
<div className="rows">
Expand Down Expand Up @@ -164,12 +164,11 @@ const Create = observer(class Create extends React.Component<I.PageComponent, St
);
};

componentDidMount(): void {
componentDidMount (): void {
U.Data.createAllSubscriptions(() => {
this.initSpace();
this.initName();
this.initType();

this.setState({ withContent: Boolean(Storage.get('withContent')) });
});
};
Expand All @@ -186,17 +185,9 @@ const Create = observer(class Create extends React.Component<I.PageComponent, St
return;
};

let check = null;
let spaceId = S.Common.space || Storage.get('lastSpaceId');

if (!spaceId) {
spaceId = spaces.find(it => it.isPersonal)?.id;
};
if (spaceId) {
check = spaces.find(it => it.id == spaceId);
};

if (!spaceId || !check) {
spaceId = spaces[0].id;
};

Expand Down Expand Up @@ -249,7 +240,7 @@ const Create = observer(class Create extends React.Component<I.PageComponent, St
return this.getObjects(J.Constant.subId.type).
map(Util.optionMapper).
filter(this.filter).
filter(it => layouts.includes(it.recommendedLayout) && (it.spaceId == S.Common.space)).
filter(it => layouts.includes(it.recommendedLayout) && (it.spaceId == S.Common.space) && (it.uniqueKey != J.Constant.typeKey.template)).
sort(U.Data.sortByName);
};

Expand Down Expand Up @@ -362,6 +353,7 @@ const Create = observer(class Create extends React.Component<I.PageComponent, St
onClose: () => $(element).removeClass('isFocused'),
data: {
canAdd: true,
canEdit: true,
filter: '',
value: this.details.tag,
maxCount: relation.maxCount,
Expand Down
9 changes: 8 additions & 1 deletion extension/scss/common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ html.anytypeWebclipper-popup {
--color-ice: #2aa7ee;
--color-teal: #0fc8ba;
--color-lime: #5dd400;
--color-green: #57c600;

/* Font */

Expand Down Expand Up @@ -98,6 +97,14 @@ html.anytypeWebclipper-popup {
--line-height-description: 26px;
--letter-spacing-description: -0.28px;

/* Menu */
--menu-width-common: 224px;
--menu-width-icon: 256px;
--menu-width-value: 288px;
--menu-width-set: 360px;
--menu-width-large: 408px;
--menu-width-add: 480px;

@import "~scss/common";
@import "~scss/form/common";
@import "~scss/component/common";
Expand Down
2 changes: 1 addition & 1 deletion middleware.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.36.0-rc8
0.37.3
Loading

0 comments on commit 9841676

Please sign in to comment.