Skip to content

Commit

Permalink
Release v0.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ChugunovRoman committed Jan 10, 2021
2 parents 63f9d86 + cca7e50 commit c255882
Show file tree
Hide file tree
Showing 159 changed files with 10,074 additions and 5,505 deletions.
9 changes: 9 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@
"[typescriptreact]": {
"editor.formatOnSave": true
},
"[scss]": {
"editor.formatOnSave": true
},
"[css]": {
"editor.formatOnSave": true
},
"[sass]": {
"editor.formatOnSave": true
},
"eslint.alwaysShowStatus": true,
"prettier.singleQuote": false,
"editor.codeActionsOnSave": {
Expand Down
300 changes: 158 additions & 142 deletions @types/Common/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,153 +1,169 @@
interface Tab {
id: number;
title?: string;
url?: string;
showBackBtn?: boolean;
moves?: boolean;
fileKey?: string;
order?: number;
id: number;
title?: string;
url?: string;
showBackBtn?: boolean;
moves?: boolean;
fileKey?: string;
order?: number;
focused?: boolean;
}

interface SavedTab {
title?: string;
url?: string;
title?: string;
url?: string;
}

interface ShortcutsMap {
accelerator: string;
value: string;
type: 'action' | 'command' | 'id';
accelerator: string;
value: string;
type: "action" | "command" | "id";
}

interface SctionState {
[state: string]: boolean;
'newFile': boolean;
'openFileBrowser': boolean;
'reopenClosedTab': boolean;
'closeTab': boolean;
'save-as': boolean;
'export-selected-exportables': boolean;
'undo': boolean;
'redo': boolean;
'paste-over-selection': boolean;
'toggle-dropper': boolean;
'set-default-style': boolean;
'copy-properties': boolean;
'paste-properties': boolean;
'selectAll': boolean;
'deselect-all': boolean;
'select-inverse': boolean;
'select-same-style': boolean;
'select-same-fill': boolean;
'select-same-stroke': boolean;
'select-same-effect': boolean;
'select-same-text': boolean;
'select-same-font': boolean;
'select-same-instance': boolean;
'toggle-grid': boolean;
'toggle-shown-layout-grids': boolean;
'toggle-show-masks': boolean;
'toggle-show-artboard-outlines': boolean;
'toggle-rulers': boolean;
'toggle-sidebar': boolean;
'toggle-ui': boolean;
'toggle-outlines': boolean;
'toggle-layers': boolean;
'toggle-publish': boolean;
'toggle-library': boolean;
'toggle-pixel-preview': boolean;
'toggle-checkerboard': boolean;
'zoom-in': boolean;
'zoom-out': boolean;
'zoom-reset': boolean;
'zoom-to-fit': boolean;
'zoom-to-selection': boolean;
'scale-normal': boolean;
'scale-inc0.1': boolean;
'scale-dic0.1': boolean;
'scale-inc0.05': boolean;
'scale-dic0.05': boolean;
'next-artboard': boolean;
'previous-artboard': boolean;
'group-selection': boolean;
'ungroup-selection': boolean;
'frame-selection': boolean;
'mask-selection': boolean;
'create-symbol': boolean;
'find-symbol': boolean;
'reset-symbol': boolean;
'detach-instance': boolean;
'resize-to-fit': boolean;
'toggle-frame-clipping': boolean;
'bring-to-front': boolean;
'bring-forward': boolean;
'send-backward': boolean;
'send-to-back': boolean;
'flip-horizontal': boolean;
'flip-vertical': boolean;
'rotate-180': boolean;
'rotate-90-counterclockwise': boolean;
'rotate-90-clockwise': boolean;
'flatten-selection': boolean;
'outline-stroke': boolean;
'live-boolean-union': boolean;
'live-boolean-subtract': boolean;
'live-boolean-intersect': boolean;
'live-boolean-xor': boolean;
'duplicate-in-place': boolean;
'delete-selection': boolean;
'convert-to-raster': boolean;
'toggle-shown-for-selected-nodes': boolean;
'toggle-locked-for-selected-nodes': boolean;
'hide-sibling-layers': boolean;
'collapse-layers': boolean;
'remove-fill': boolean;
'remove-stroke': boolean;
'swap-fill-and-stroke': boolean;
'join-selection': boolean;
'smooth-join-selection': boolean;
'delete-and-heal-selection': boolean;
'text-toggle-bold': boolean;
'text-toggle-italic': boolean;
'text-toggle-underline': boolean;
'text-toggle-strikethrough': boolean;
'text-original-case': boolean;
'text-upper-case': boolean;
'text-lower-case': boolean;
'round-to-pixels': boolean;
'align-left': boolean;
'align-horizontal-center': boolean;
'align-right': boolean;
'align-top': boolean;
'align-vertical-center': boolean;
'align-bottom': boolean;
'pack-horizontal': boolean;
'pack-vertical': boolean;
'distribute-horizontal-spacing': boolean;
'distribute-vertical-spacing': boolean;
'distribute-left': boolean;
'distribute-horizontal-center': boolean;
'distribute-right': boolean;
'distribute-top': boolean;
'distribute-vertical-center': boolean;
'distribute-bottom': boolean;
type View = "TopPanel" | "Settings" | "ThemeCreator";
type SettingsView = "General" | "Themes";

// TODO: don't uses?
interface SectionState {
[state: string]: boolean;
newFile: boolean;
openFileBrowser: boolean;
reopenClosedTab: boolean;
closeTab: boolean;
"save-as": boolean;
"export-selected-exportables": boolean;
undo: boolean;
redo: boolean;
"paste-over-selection": boolean;
"toggle-dropper": boolean;
"set-default-style": boolean;
"copy-properties": boolean;
"paste-properties": boolean;
selectAll: boolean;
"deselect-all": boolean;
"select-inverse": boolean;
"select-same-style": boolean;
"select-same-fill": boolean;
"select-same-stroke": boolean;
"select-same-effect": boolean;
"select-same-text": boolean;
"select-same-font": boolean;
"select-same-instance": boolean;
"toggle-grid": boolean;
"toggle-shown-layout-grids": boolean;
"toggle-show-masks": boolean;
"toggle-show-artboard-outlines": boolean;
"toggle-rulers": boolean;
"toggle-sidebar": boolean;
"toggle-ui": boolean;
"toggle-outlines": boolean;
"toggle-layers": boolean;
"toggle-publish": boolean;
"toggle-library": boolean;
"toggle-pixel-preview": boolean;
"toggle-checkerboard": boolean;
"zoom-in": boolean;
"zoom-out": boolean;
"zoom-reset": boolean;
"zoom-to-fit": boolean;
"zoom-to-selection": boolean;
"scale-normal": boolean;
"scale-inc0.1": boolean;
"scale-dic0.1": boolean;
"scale-inc0.05": boolean;
"scale-dic0.05": boolean;
"next-artboard": boolean;
"previous-artboard": boolean;
"group-selection": boolean;
"ungroup-selection": boolean;
"frame-selection": boolean;
"mask-selection": boolean;
"create-symbol": boolean;
"find-symbol": boolean;
"reset-symbol": boolean;
"detach-instance": boolean;
"resize-to-fit": boolean;
"toggle-frame-clipping": boolean;
"bring-to-front": boolean;
"bring-forward": boolean;
"send-backward": boolean;
"send-to-back": boolean;
"flip-horizontal": boolean;
"flip-vertical": boolean;
"rotate-180": boolean;
"rotate-90-counterclockwise": boolean;
"rotate-90-clockwise": boolean;
"flatten-selection": boolean;
"outline-stroke": boolean;
"live-boolean-union": boolean;
"live-boolean-subtract": boolean;
"live-boolean-intersect": boolean;
"live-boolean-xor": boolean;
"duplicate-in-place": boolean;
"delete-selection": boolean;
"convert-to-raster": boolean;
"toggle-shown-for-selected-nodes": boolean;
"toggle-locked-for-selected-nodes": boolean;
"hide-sibling-layers": boolean;
"collapse-layers": boolean;
"remove-fill": boolean;
"remove-stroke": boolean;
"swap-fill-and-stroke": boolean;
"join-selection": boolean;
"smooth-join-selection": boolean;
"delete-and-heal-selection": boolean;
"text-toggle-bold": boolean;
"text-toggle-italic": boolean;
"text-toggle-underline": boolean;
"text-toggle-strikethrough": boolean;
"text-original-case": boolean;
"text-upper-case": boolean;
"text-lower-case": boolean;
"round-to-pixels": boolean;
"align-left": boolean;
"align-horizontal-center": boolean;
"align-right": boolean;
"align-top": boolean;
"align-vertical-center": boolean;
"align-bottom": boolean;
"pack-horizontal": boolean;
"pack-vertical": boolean;
"distribute-horizontal-spacing": boolean;
"distribute-vertical-spacing": boolean;
"distribute-left": boolean;
"distribute-horizontal-center": boolean;
"distribute-right": boolean;
"distribute-top": boolean;
"distribute-vertical-center": boolean;
"distribute-bottom": boolean;
}

interface FeatureFlags {
desktop_beta_use_agent_for_fonts?: boolean;
}

interface ISettings {
app: {
panelHeight: number;
showMainMenu: boolean;
disabledMainMenu: boolean;
saveLastOpenedTabs: boolean;
windowFrame: boolean;
disabledFonts: boolean;
exportDir: string;
fontDirs: string[];
lastOpenedTabs: SavedTab[];
};
ui: {
scalePanel: number;
scaleFigmaUI: number;
};
[path: string]: any;
}
interface SettingsInterface {
clientId: string;
app: {
logLevel: number;
enableColorSpaceSrgb: boolean;
visibleNewProjectBtn: boolean;
panelHeight: number;
saveLastOpenedTabs: boolean;
exportDir: string;
fontDirs: string[];
lastOpenedTabs: SavedTab[];
featureFlags: FeatureFlags;
savedExtensions: Extensions.ExtensionJson[];
lastSavedPluginDir?: string;
lastExportDir?: string;
};
ui: {
scalePanel: number;
scaleFigmaUI: number;
};
theme: {
currentTheme: string;
};
[path: string]: any;
}
15 changes: 9 additions & 6 deletions @types/Common/menu.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ declare namespace Menu {
* Public types
*/
type NativeClick = (item: _MenuItem, window: _BrowserWindow, event: Event) => void;
type CutsomClick = (item: _MenuItemConstructorOptions, window: _BrowserWindow, event: Event) => void;
type CustomClick = (item: _MenuItemConstructorOptions, window: _BrowserWindow, event: Event) => void;

type Params = ParamsId | ParamsAction | ParamsCommand;
type MenuItem = Items.MenuName & (Items.PluginItem | Items.Separator | Items.Submenu | Items.Menu | Items.StringKey);
Expand All @@ -26,7 +26,10 @@ declare namespace Menu {
type: string;
key: string;
string: string;
plugin: string;
plugin?: string;
visible?: boolean;
disabled?: boolean;
click?: (menuItem: Menu.PluginMenuItem, browserWindow: _BrowserWindow | undefined, event: KeyboardEvent) => void;
}

interface Separator {
Expand All @@ -38,8 +41,8 @@ declare namespace Menu {
submenu: [MenuName & Separator & Submenu & Menu & PluginItem & StringKey];
}
interface Menu {
disabled?: boolean;
type: "run-menu-action";
disabled?: boolean;
menuAction: MenuAction;
name: MenuName;
}
Expand All @@ -59,14 +62,14 @@ declare namespace Menu {

interface ParamsId {
id: string;
click?: NativeClick | CutsomClick;
click?: NativeClick | CustomClick;
}
interface ParamsAction {
action: string;
click?: NativeClick | CutsomClick;
click?: NativeClick | CustomClick;
}
interface ParamsCommand {
command: string;
click?: NativeClick | CutsomClick;
click?: NativeClick | CustomClick;
}
}
Loading

0 comments on commit c255882

Please sign in to comment.