Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
ra3orblade committed Jan 31, 2025
2 parents bd9681e + c20b775 commit ab00175
Show file tree
Hide file tree
Showing 110 changed files with 1,177 additions and 547 deletions.
6 changes: 5 additions & 1 deletion dist/challenge/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
body { font-family: 'Inter', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 22px; background-color: #fff; color: #252525; }

.content { display: flex; align-items: center; justify-content: center; flex-direction: column; padding: 16px; height: 100%; }
.title { font-size: 18px; line-height: 26px; letter-spacing: -0.28px; font-weight: 700; margin: 0px 0px 24px 0px; text-align: center; }
.title { font-size: 18px; line-height: 26px; letter-spacing: -0.28px; font-weight: 700; margin: 0px 0px 4px 0px; text-align: center; }
.description { font-size: 14px; line-height: 22px; letter-spacing: -0.28px; font-weight: 400; margin: 0px 0px 24px 0px; text-align: center; }

#challenge { display: flex; align-items: center; justify-content: center; flex-direction: row; gap: 0px 8px; }
#challenge .number { background-color: #f2f2f2; border-radius: 12px; font-weight: 700; font-size: 36px; line-height: 40px; padding: 12px; }
Expand All @@ -31,13 +32,15 @@
<body>
<div class="content">
<div id="title" class="title"></div>
<div id="description" class="description"></div>
<div id="challenge"></div>
</div>
<script type="text/javascript">
$(() => {
const win = $(window);
const html = $('html')
const title = $('#title');
const description = $('#description');
const challengeEl = $('#challenge');

window.Electron.on('challenge', (e, data) => {
Expand All @@ -57,6 +60,7 @@
contentType: 'application/json',
success: data => {
title.text(data.challengeTitle);
description.text(data.challengeDescription);
},
});
});
Expand Down
14 changes: 13 additions & 1 deletion electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@ const remote = require('@electron/remote/main');
const { installNativeMessagingHost } = require('./electron/js/lib/installNativeMessagingHost.js');
const binPath = fixPathForAsarUnpack(path.join(__dirname, 'dist', `anytypeHelper${is.windows ? '.exe' : ''}`));
const Store = require('electron-store');
const suffix = app.isPackaged ? '' : 'dev';
const store = new Store({ name: [ 'localStorage', suffix ].join('-') });

// Fix notifications app name
if (is.windows) {
app.setAppUserModelId(app.name);
};

storage.setDataPath(app.getPath('userData'));
Store.initRenderer();
//Store.initRenderer();

const Api = require('./electron/js/api.js');
const ConfigManager = require('./electron/js/config.js');
Expand Down Expand Up @@ -53,6 +55,16 @@ powerMonitor.on('resume', () => {
Util.log('info', '[PowerMonitor] resume');
});

ipcMain.on('storeGet', (e, key) => {
e.returnValue = store.get(key);
});
ipcMain.on('storeSet', (e, key, value) => {
e.returnValue = store.set(key, value);
});
ipcMain.on('storeDelete', (e, key) => {
e.returnValue = store.delete(key);
});

let deeplinkingUrl = '';
let waitLibraryPromise = null;
let mainWindow = null;
Expand Down
4 changes: 4 additions & 0 deletions electron/js/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,10 @@ class Api {
WindowManager.createChallenge(param);
};

hideChallenge (win, param) {
WindowManager.closeChallenge(param);
};

reload (win, route) {
win.route = route;
win.webContents.reload();
Expand Down
1 change: 1 addition & 0 deletions electron/js/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ class MenuManager {
{ label: Util.translate('electronMenuDebugReconcile'), click: () => Util.send(this.win, 'commandGlobal', 'debugReconcile') },
{ label: Util.translate('electronMenuDebugNet'), click: () => Util.send(this.win, 'commandGlobal', 'debugNet') },
{ label: Util.translate('electronMenuDebugLog'), click: () => Util.send(this.win, 'commandGlobal', 'debugLog') },
{ label: Util.translate('electronMenuDebugProfiler'), click: () => Util.send(this.win, 'commandGlobal', 'debugProfiler') },

Separator,

Expand Down
9 changes: 3 additions & 6 deletions electron/js/preload.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ const os = require('os');
const path = require('path');
const mime = require('mime-types');
const tmpPath = () => app.getPath('temp');
const Store = require('electron-store');
const suffix = app.isPackaged ? '' : 'dev';
const store = new Store({ name: [ 'localStorage', suffix ].join('-') });

contextBridge.exposeInMainWorld('Electron', {
version: {
Expand All @@ -19,9 +16,9 @@ contextBridge.exposeInMainWorld('Electron', {
platform: os.platform(),
arch: process.arch,

storeSet: (key, value) => store.set(key, value),
storeGet: key => store.get(key),
storeDelete: key => store.delete(key),
storeGet: key => ipcRenderer.sendSync('storeGet', key),
storeSet: (key, value) => ipcRenderer.sendSync('storeSet', key, value),
storeDelete: key => ipcRenderer.sendSync('storeDelete', key),

isPackaged: app.isPackaged,
userPath: () => app.getPath('userData'),
Expand Down
32 changes: 18 additions & 14 deletions electron/js/window.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ class WindowManager {
list = new Set();

create (options, param) {
const { route, isChild } = options;
const { hideMenuBar } = ConfigManager.config;

param = Object.assign({
Expand All @@ -45,8 +44,7 @@ class WindowManager {

remote.enable(win.webContents);

win.isChild = isChild;
win.route = route;
win = Object.assign(win, options);
win.windowId = win.id;

this.list.add(win);
Expand Down Expand Up @@ -144,33 +142,39 @@ class WindowManager {
createChallenge (options) {
const { screen } = require('electron');
const primaryDisplay = screen.getPrimaryDisplay();
const { width } = primaryDisplay.workAreaSize;
const { width, height } = primaryDisplay.workAreaSize;

const win = this.create({}, {
const win = this.create({ ...options, isChallenge: true }, {
backgroundColor: '',
width: 424,
height: 232,
x: Math.floor(width / 2 - 212),
y: 50,
y: Math.floor(height - 282),
titleBarStyle: 'hidden',
alwaysOnTop: true,
focusable: true,
skipTaskbar: true,
});

win.loadURL('file://' + path.join(Util.appPath, 'dist', 'challenge', `index.html`));
win.setVisibleOnAllWorkspaces(true, { visibleOnFullScreen: true });
win.loadURL('file://' + path.join(Util.appPath, 'dist', 'challenge', 'index.html'));
win.setMenu(null);

is.windows || is.linux ? win.showInactive() : win.show();
win.focus();
win.showInactive(); // show inactive to prevent focus loose from other app

win.webContents.once('did-finish-load', () => {
win.webContents.postMessage('challenge', options);
});

setTimeout(() => {
if (win && !win.isDestroyed()) {
setTimeout(() => this.closeChallenge(options), 30000);
return win;
};

closeChallenge (options) {
for (const win of this.list) {
if (win && win.isChallenge && (win.challenge == options.challenge) && !win.isDestroyed()) {
win.close();
};
}, 30000);
return win;
};
};

command (win, cmd, param) {
Expand Down
2 changes: 2 additions & 0 deletions extension/popup/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ const Index = observer(class Index extends React.Component<I.PageComponent, Stat
login () {
const appKey = Storage.get('appKey');

console.log('appKey', appKey);

if (appKey) {
Util.authorize(appKey, () => {
const { serverPort, gatewayPort } = S.Extension;
Expand Down
2 changes: 1 addition & 1 deletion middleware.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.39.0-rc02
0.39.2
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 2 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "anytype",
"version": "0.44.4-alpha",
"version": "0.44.15-beta",
"description": "Anytype",
"main": "electron.js",
"scripts": {
Expand Down Expand Up @@ -206,19 +206,7 @@
"node_modules/p-finally",
"node_modules/file-type",
"node_modules/regedit",
"node_modules/mime-types",
"node_modules/electron-store",
"node_modules/conf",
"node_modules/dot-prop",
"node_modules/is-obj",
"node_modules/pkg-up",
"node_modules/env-paths",
"node_modules/atomically",
"node_modules/fast-deep-equal",
"node_modules/fast-uri",
"node_modules/ajv-formats",
"node_modules/debounce-fn",
"node_modules/semver"
"node_modules/mime-types"
],
"extraResources": [
{
Expand Down
4 changes: 4 additions & 0 deletions src/img/icon/info.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/img/icon/widget/button/arrow.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/img/icon/widget/button/chat.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 20 additions & 5 deletions src/json/text.json
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@
"commonPin": "Pin on top",
"commonUnpin": "Unpin",
"commonOpenType": "Open Type",
"commonManage": "Manage",
"commonSize": "Size",

"pluralDay": "day|days",
"pluralObject": "Object|Objects",
Expand Down Expand Up @@ -245,6 +247,7 @@
"electronMenuDebugReconcile": "Reconcile",
"electronMenuDebugNet": "Network",
"electronMenuDebugLog": "Export log",
"electronMenuDebugProfiler": "Export CPU trace",
"electronMenuClose": "Close Window",
"electronMenuEdit": "Edit",
"electronMenuUndo": "Undo",
Expand Down Expand Up @@ -781,7 +784,6 @@
"popupSettingsSpacesListSpace": "Space",
"popupSettingsSpacesCancelRequest": "Cancel request",
"popupSettingsSpacesListAccess": "Access",
"popupSettingsSpacesListSize": "Size",
"popupSettingsSpacesListNetwork": "Network",
"popupSettingsSpacesListDevice": "Device",

Expand All @@ -797,6 +799,9 @@
"popupSettingsDataManagementDeleteText": "Once you request your vault to be deleted, you have 30 days to cancel this request. After 30 days, your encrypted vault data is permanently removed from the backup node, you won't be able to sign into Anytype on new devices.",
"popupSettingsDataManagementDeleteButton": "Delete vault",

"popupSettingsDataManagementDataPublishTitle": "My Sites",
"popupSettingsDataManagementDataPublishDate": "Published date",

"popupSettingsSpaceIndexTitle": "Space Settings",
"popupSettingsSpaceIndexDescriptionPlaceholder": "Add a few words about the space...",
"popupSettingsSpaceIndexSpaceTypePersonalTooltipTitle": "End-to-end encryption (E2EE)",
Expand Down Expand Up @@ -902,7 +907,6 @@
"popupSettingsMembershipPerGenericMany": "per %s %s",
"popupSettingsMembershipLearnMore": "Learn more",
"popupSettingsMembershipCurrent": "Current",
"popupSettingsMembershipManage": "Manage",
"popupSettingsMembershipValidUntil": "Valid until %s",
"popupSettingsMembershipForeverFree": "Forever free",
"popupSettingsMembershipPending": "Pending...",
Expand Down Expand Up @@ -1623,8 +1627,15 @@
"menuSyncStatusEmpty": "There are no objects to show",

"menuPublishTitle": "Publish to web",
"menuPublishLabel": "Join Space Button",
"menuPublishButton": "Publish",
"menuPublishInfoTooltip": "Published object will be uploaded to our publishing server and will be accessible via the URL as a static, unencrypted HTML page. Linked objects will not be published.<br/>Currently, not all blocks are supported for publishing, such as sets, collections, and relations.",
"menuPublishLabelJoin": "Join Space Button",
"menuPublishButtonPublish": "Publish",
"menuPublishButtonUnpublish": "Unpublish",
"menuPublishButtonUpdate": "Update",
"menuPublishButtonView": "View in Browser",
"menuPublishButtonOpen": "Open Object",
"menuPublishButtonCopy": "Copy Web Link",
"menuPublishLabelOffline": "No internet connection",

"previewEdit": "Edit Link",

Expand Down Expand Up @@ -2135,6 +2146,8 @@
"errorSpaceMakeShareable103": "Oops! The request failed. Please check your Internet connection and try again.",
"errorSpaceMakeShareable104": "Limit reached for this space. Please upgrade your membership or contact support for assistance.",

"errorPublishingCreate103": "Looks like some files are over 100 MB. Please remove or slim them down and try again.",

"errorIncorrectEmail": "Incorrect E-mail",

"origin0": "Empty",
Expand All @@ -2146,6 +2159,7 @@
"origin6": "Use case",
"origin7": "Library installed",
"origin8": "Bookmark",
"origin9": "API",

"emojiCategoryPeople": "Smileys & People",
"emojiCategoryNature": "Animals & Nature",
Expand Down Expand Up @@ -2227,7 +2241,8 @@
"spaceStatus9": "Joining",
"spaceStatus10": "Removing",

"challengeTitle": "Please enter the following numbers in the extension",
"challengeTitle": "Grant Limited Access",
"challengeDescription": "This extension requires a 4-digit code for limited access to your account. Proceed only if you trust the extension.",
"webclipperEmptySelection": "Selection is empty",

"paymentMethod0": "None",
Expand Down
7 changes: 4 additions & 3 deletions src/json/url.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ export default {
invite: 'https://invite.any.coop/%s#%s',
share: 'https://join.anytype.io/',
notionFAQ: 'https://doc.anytype.io/anytype-docs/basics/space/import-export#notion-import-faq',
publishDomain: '%s.coop',
publish: 'https://any.coop/%s/',
publishDomain: '%s.org',
publish: 'any.coop/%s',
api: '127.0.0.1:31009',

survey: {
register: 'https://community.anytype.io/survey0',
Expand All @@ -34,4 +35,4 @@ export default {
shared: 'https://community.anytype.io/survey4',
multiplayer: 'https://community.anytype.io/survey5'
}
};
};
2 changes: 1 addition & 1 deletion src/scss/block/dataview/cell.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

.cellContent { cursor: default; }
.cellContent {
.iconObject { margin-right: 8px; vertical-align: top; flex-shrink: 0; cursor: default; }
.iconObject { flex-shrink: 0; cursor: default; }
.icon.clear { display: none; }

.name { display: inline-block; vertical-align: top; user-select: text !important; }
Expand Down
Loading

0 comments on commit ab00175

Please sign in to comment.