fontastic 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.editorconfig +16 -0
- package/.eslintrc.json +54 -0
- package/.github/FUNDING.yml +12 -0
- package/.github/ISSUE_TEMPLATE/bug_report.md +29 -0
- package/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
- package/.github/dependabot.yml +6 -0
- package/.github/pull_request_template.md +21 -0
- package/.github/stale.yml +17 -0
- package/.github/workflows/macos.yml +58 -0
- package/.github/workflows/ubuntu.yml +70 -0
- package/.github/workflows/windows.yml +64 -0
- package/.node-version +1 -0
- package/.vscode/launch.json +46 -0
- package/.vscode/tasks.json +49 -0
- package/CODE_OF_CONDUCT.md +45 -0
- package/CONTRIBUTING.md +72 -0
- package/LICENSE +21 -0
- package/README.md +111 -0
- package/_config.yml +1 -0
- package/angular.json +194 -0
- package/angular.webpack.js +32 -0
- package/app/Application.js +40 -0
- package/app/Application.ts +38 -0
- package/app/config/alert.ts +32 -0
- package/app/config/database.js +203 -0
- package/app/config/database.ts +202 -0
- package/app/config/index.js +20 -0
- package/app/config/index.ts +3 -0
- package/app/config/mimes.js +49 -0
- package/app/config/mimes.ts +54 -0
- package/app/config/system.js +497 -0
- package/app/config/system.ts +498 -0
- package/app/config/themes.ts +38 -0
- package/app/core/AppLogger.js +31 -0
- package/app/core/AppLogger.ts +38 -0
- package/app/core/ConfigManager.js +114 -0
- package/app/core/ConfigManager.ts +137 -0
- package/app/core/ConnectionManager.js +83 -0
- package/app/core/ConnectionManager.ts +95 -0
- package/app/core/FontCatalog.js +51 -0
- package/app/core/FontCatalog.ts +42 -0
- package/app/core/FontFinder.js +86 -0
- package/app/core/FontFinder.ts +96 -0
- package/app/core/FontInstaller.js +67 -0
- package/app/core/FontInstaller.ts +63 -0
- package/app/core/FontManager.js +165 -0
- package/app/core/FontManager.ts +172 -0
- package/app/core/FontObject.js +54 -0
- package/app/core/FontObject.ts +62 -0
- package/app/core/MessageHandler.js +272 -0
- package/app/core/MessageHandler.ts +337 -0
- package/app/core/SystemManager.js +140 -0
- package/app/core/SystemManager.ts +171 -0
- package/app/core/menu/Example.ts +280 -0
- package/app/core/menu/MenuBuilder.js +45 -0
- package/app/core/menu/MenuBuilder.ts +53 -0
- package/app/core/menu/templates/DarwinTemplate.js +127 -0
- package/app/core/menu/templates/DarwinTemplate.ts +142 -0
- package/app/core/menu/templates/SystemTemplate.js +124 -0
- package/app/core/menu/templates/SystemTemplate.ts +139 -0
- package/app/database/entity/Collection.schema.js +99 -0
- package/app/database/entity/Collection.schema.ts +68 -0
- package/app/database/entity/Logger.schema.js +50 -0
- package/app/database/entity/Logger.schema.ts +26 -0
- package/app/database/entity/Store.schema.js +165 -0
- package/app/database/entity/Store.schema.ts +116 -0
- package/app/database/entity/index.js +20 -0
- package/app/database/entity/index.ts +3 -0
- package/app/database/repository/Collection.repository.js +181 -0
- package/app/database/repository/Collection.repository.ts +190 -0
- package/app/database/repository/Logger.repository.js +25 -0
- package/app/database/repository/Logger.repository.ts +11 -0
- package/app/database/repository/Store.repository.js +328 -0
- package/app/database/repository/Store.repository.ts +358 -0
- package/app/database/repository/User.repository.js +12 -0
- package/app/database/repository/User.repository.ts +8 -0
- package/app/database/repository/index.js +20 -0
- package/app/database/repository/index.ts +3 -0
- package/app/enums/ChannelType.js +62 -0
- package/app/enums/ChannelType.ts +65 -0
- package/app/enums/StorageType.js +19 -0
- package/app/enums/index.js +19 -0
- package/app/enums/index.ts +2 -0
- package/app/enums/storageType.ts +14 -0
- package/app/helpers/command.js +28 -0
- package/app/helpers/command.ts +20 -0
- package/app/helpers/random.js +16 -0
- package/app/helpers/random.ts +12 -0
- package/app/main.js +82 -0
- package/app/main.ts +94 -0
- package/app/package-lock.json +2649 -0
- package/app/package.json +35 -0
- package/app/types/AppAlert.js +3 -0
- package/app/types/AppAlert.ts +8 -0
- package/app/types/AuthUser.js +7 -0
- package/app/types/AuthUser.ts +5 -0
- package/app/types/Breadcrumb.js +3 -0
- package/app/types/Breadcrumb.ts +5 -0
- package/app/types/ImportOptions.js +7 -0
- package/app/types/ImportOptions.ts +3 -0
- package/app/types/QueryOptions.js +3 -0
- package/app/types/QueryOptions.ts +12 -0
- package/app/types/SystemConfig.js +3 -0
- package/app/types/SystemConfig.ts +132 -0
- package/app/types/SystemStats.js +3 -0
- package/app/types/SystemStats.ts +7 -0
- package/app/types/SystemTheme.js +3 -0
- package/app/types/SystemTheme.ts +5 -0
- package/app/types/index.js +25 -0
- package/app/types/index.ts +8 -0
- package/docs/logo.png +0 -0
- package/docs/screenshots/readme.md +7 -0
- package/docs/screenshots/screen-grab1.png +0 -0
- package/docs/screenshots/screen-grab2.png +0 -0
- package/docs/screenshots/screen-grab3.png +0 -0
- package/e2e/main.spec.ts +59 -0
- package/e2e/playwright.config.ts +19 -0
- package/e2e/tsconfig.e2e.json +13 -0
- package/electron-builder.json +71 -0
- package/package.json +121 -0
- package/src/app/app-routing.module.ts +15 -0
- package/src/app/app.component.html +1 -0
- package/src/app/app.component.scss +0 -0
- package/src/app/app.component.spec.ts.dist +33 -0
- package/src/app/app.component.ts +37 -0
- package/src/app/app.module.ts +63 -0
- package/src/app/core/core.module.ts +11 -0
- package/src/app/core/model/AuthUserModel.ts +7 -0
- package/src/app/core/model/CustomThemeModel.ts +7 -0
- package/src/app/core/model/DbConnectionModel.ts +16 -0
- package/src/app/core/model/ImportOptionsModel.ts +5 -0
- package/src/app/core/model/LatestNewsModel.ts +7 -0
- package/src/app/core/model/SearchFormModel.ts +10 -0
- package/src/app/core/model/index.ts +6 -0
- package/src/app/core/services/alert/alert.service.spec.ts +22 -0
- package/src/app/core/services/alert/alert.service.ts +71 -0
- package/src/app/core/services/auth/auth.service.ts +30 -0
- package/src/app/core/services/boot/boot.service.ts +33 -0
- package/src/app/core/services/breadcrumb/breadcrumb.service.spec.ts +22 -0
- package/src/app/core/services/breadcrumb/breadcrumb.service.ts +30 -0
- package/src/app/core/services/config/config.service.ts +63 -0
- package/src/app/core/services/database/database.service.ts +286 -0
- package/src/app/core/services/electron/electron.service.spec.ts +12 -0
- package/src/app/core/services/electron/electron.service.ts +62 -0
- package/src/app/core/services/font/font.service.ts +79 -0
- package/src/app/core/services/gravatar/gravatar.service.spec.ts +16 -0
- package/src/app/core/services/gravatar/gravatar.service.ts +18 -0
- package/src/app/core/services/index.ts +14 -0
- package/src/app/core/services/message/message.service.ts +289 -0
- package/src/app/core/services/modal/modal.service.spec.ts +16 -0
- package/src/app/core/services/modal/modal.service.ts +34 -0
- package/src/app/core/services/news/news.service.ts +94 -0
- package/src/app/core/services/presentation/presentation.service.ts +341 -0
- package/src/app/core/services/utils/utils.service.spec.ts +12 -0
- package/src/app/core/services/utils/utils.service.ts +144 -0
- package/src/app/layout/aside/aside.component.html +9 -0
- package/src/app/layout/aside/aside.component.scss +1 -0
- package/src/app/layout/aside/aside.component.ts +26 -0
- package/src/app/layout/footer/footer.component.html +11 -0
- package/src/app/layout/footer/footer.component.scss +27 -0
- package/src/app/layout/footer/footer.component.ts +32 -0
- package/src/app/layout/header/header.component.html +35 -0
- package/src/app/layout/header/header.component.scss +60 -0
- package/src/app/layout/header/header.component.ts +229 -0
- package/src/app/layout/layout.component.html +14 -0
- package/src/app/layout/layout.component.scss +119 -0
- package/src/app/layout/layout.component.ts +23 -0
- package/src/app/layout/layout.module.ts +32 -0
- package/src/app/layout/layout.service.ts +13 -0
- package/src/app/layout/navigation/navigation.component.html +142 -0
- package/src/app/layout/navigation/navigation.component.scss +0 -0
- package/src/app/layout/navigation/navigation.component.ts +302 -0
- package/src/app/pages/main/grid/grid.component.html +160 -0
- package/src/app/pages/main/grid/grid.component.scss +3 -0
- package/src/app/pages/main/grid/grid.component.ts +98 -0
- package/src/app/pages/main/inspect/inspect.component.html +7 -0
- package/src/app/pages/main/inspect/inspect.component.scss +3 -0
- package/src/app/pages/main/inspect/inspect.component.ts +66 -0
- package/src/app/pages/main/main-routing.module.ts +30 -0
- package/src/app/pages/main/main.component.html +6 -0
- package/src/app/pages/main/main.component.scss +191 -0
- package/src/app/pages/main/main.component.ts +35 -0
- package/src/app/pages/main/main.module.ts +28 -0
- package/src/app/pages/main/preview/preview.component.html +46 -0
- package/src/app/pages/main/preview/preview.component.scss +0 -0
- package/src/app/pages/main/preview/preview.component.ts +239 -0
- package/src/app/pages/main/toolbar/toolbar.component.html +78 -0
- package/src/app/pages/main/toolbar/toolbar.component.scss +3 -0
- package/src/app/pages/main/toolbar/toolbar.component.ts +132 -0
- package/src/app/shared/components/alert/alert.component.html +9 -0
- package/src/app/shared/components/alert/alert.component.scss +0 -0
- package/src/app/shared/components/alert/alert.component.ts +37 -0
- package/src/app/shared/components/breadcrumbs/breadcrumbs.component.html +14 -0
- package/src/app/shared/components/breadcrumbs/breadcrumbs.component.scss +0 -0
- package/src/app/shared/components/breadcrumbs/breadcrumbs.component.ts +36 -0
- package/src/app/shared/components/button/button.component.html +3 -0
- package/src/app/shared/components/button/button.component.scss +2 -0
- package/src/app/shared/components/button/button.component.ts +22 -0
- package/src/app/shared/components/collection/create-collection/create-collection.component.html +41 -0
- package/src/app/shared/components/collection/create-collection/create-collection.component.scss +0 -0
- package/src/app/shared/components/collection/create-collection/create-collection.component.ts +68 -0
- package/src/app/shared/components/collection/form-collection/form-collection.component.html +1 -0
- package/src/app/shared/components/collection/form-collection/form-collection.component.scss +0 -0
- package/src/app/shared/components/collection/form-collection/form-collection.component.ts +15 -0
- package/src/app/shared/components/collection/update-collection/update-collection.component.html +40 -0
- package/src/app/shared/components/collection/update-collection/update-collection.component.scss +0 -0
- package/src/app/shared/components/collection/update-collection/update-collection.component.ts +71 -0
- package/src/app/shared/components/glyph-list/glyph-list.component.html +40 -0
- package/src/app/shared/components/glyph-list/glyph-list.component.scss +1 -0
- package/src/app/shared/components/glyph-list/glyph-list.component.ts +165 -0
- package/src/app/shared/components/glyph-view/glyph-view.component.html +23 -0
- package/src/app/shared/components/glyph-view/glyph-view.component.scss +0 -0
- package/src/app/shared/components/glyph-view/glyph-view.component.ts +228 -0
- package/src/app/shared/components/index.ts +16 -0
- package/src/app/shared/components/loading/loading.component.html +1 -0
- package/src/app/shared/components/loading/loading.component.scss +0 -0
- package/src/app/shared/components/loading/loading.component.ts +26 -0
- package/src/app/shared/components/modal/modal.component.html +31 -0
- package/src/app/shared/components/modal/modal.component.scss +0 -0
- package/src/app/shared/components/modal/modal.component.ts +51 -0
- package/src/app/shared/components/page-not-found/page-not-found.component.html +3 -0
- package/src/app/shared/components/page-not-found/page-not-found.component.scss +0 -0
- package/src/app/shared/components/page-not-found/page-not-found.component.ts +12 -0
- package/src/app/shared/components/paginator/paginator.component.html +21 -0
- package/src/app/shared/components/paginator/paginator.component.scss +3 -0
- package/src/app/shared/components/paginator/paginator.component.ts +133 -0
- package/src/app/shared/components/pairing/pairing.component.html +20 -0
- package/src/app/shared/components/pairing/pairing.component.scss +0 -0
- package/src/app/shared/components/pairing/pairing.component.ts +33 -0
- package/src/app/shared/components/search/search.component.html +54 -0
- package/src/app/shared/components/search/search.component.scss +10 -0
- package/src/app/shared/components/search/search.component.ts +77 -0
- package/src/app/shared/components/settings/database/database.component.html +151 -0
- package/src/app/shared/components/settings/database/database.component.scss +0 -0
- package/src/app/shared/components/settings/database/database.component.ts +145 -0
- package/src/app/shared/components/settings/general/general.component.html +170 -0
- package/src/app/shared/components/settings/general/general.component.scss +0 -0
- package/src/app/shared/components/settings/general/general.component.ts +150 -0
- package/src/app/shared/components/settings/logs/logs.component.html +44 -0
- package/src/app/shared/components/settings/logs/logs.component.scss +0 -0
- package/src/app/shared/components/settings/logs/logs.component.ts +37 -0
- package/src/app/shared/components/settings/news/news.component.html +41 -0
- package/src/app/shared/components/settings/news/news.component.scss +0 -0
- package/src/app/shared/components/settings/news/news.component.ts +52 -0
- package/src/app/shared/components/settings/settings.component.html +46 -0
- package/src/app/shared/components/settings/settings.component.scss +0 -0
- package/src/app/shared/components/settings/settings.component.ts +23 -0
- package/src/app/shared/components/settings/system/system.component.html +30 -0
- package/src/app/shared/components/settings/system/system.component.scss +0 -0
- package/src/app/shared/components/settings/system/system.component.ts +43 -0
- package/src/app/shared/components/settings/theme/theme.component.html +22 -0
- package/src/app/shared/components/settings/theme/theme.component.scss +0 -0
- package/src/app/shared/components/settings/theme/theme.component.ts +50 -0
- package/src/app/shared/components/spinner/spinner.component.html +1 -0
- package/src/app/shared/components/spinner/spinner.component.scss +0 -0
- package/src/app/shared/components/spinner/spinner.component.ts +26 -0
- package/src/app/shared/components/store/store.component.html +22 -0
- package/src/app/shared/components/store/store.component.scss +10 -0
- package/src/app/shared/components/store/store.component.ts +58 -0
- package/src/app/shared/components/tables/tables.component.html +47 -0
- package/src/app/shared/components/tables/tables.component.scss +10 -0
- package/src/app/shared/components/tables/tables.component.ts +81 -0
- package/src/app/shared/components/typescale/typescale.component.html +53 -0
- package/src/app/shared/components/typescale/typescale.component.scss +0 -0
- package/src/app/shared/components/typescale/typescale.component.ts +168 -0
- package/src/app/shared/directives/gravatar/gravatar.directive.ts +29 -0
- package/src/app/shared/directives/index.ts +2 -0
- package/src/app/shared/directives/webview/webview.directive.ts +8 -0
- package/src/app/shared/pipes/installable.pipe.ts +10 -0
- package/src/app/shared/pipes/prettybytes.pipe.ts +10 -0
- package/src/app/shared/pipes/safehtml.pipe.ts +10 -0
- package/src/app/shared/shared.module.ts +92 -0
- package/src/assets/.gitkeep +0 -0
- package/src/assets/fonts/fa/fa-brands-400.eot +0 -0
- package/src/assets/fonts/fa/fa-brands-400.svg +3535 -0
- package/src/assets/fonts/fa/fa-brands-400.ttf +0 -0
- package/src/assets/fonts/fa/fa-brands-400.woff +0 -0
- package/src/assets/fonts/fa/fa-brands-400.woff2 +0 -0
- package/src/assets/fonts/fa/fa-regular-400.eot +0 -0
- package/src/assets/fonts/fa/fa-regular-400.svg +803 -0
- package/src/assets/fonts/fa/fa-regular-400.ttf +0 -0
- package/src/assets/fonts/fa/fa-regular-400.woff +0 -0
- package/src/assets/fonts/fa/fa-regular-400.woff2 +0 -0
- package/src/assets/fonts/fa/fa-solid-900.eot +0 -0
- package/src/assets/fonts/fa/fa-solid-900.svg +4700 -0
- package/src/assets/fonts/fa/fa-solid-900.ttf +0 -0
- package/src/assets/fonts/fa/fa-solid-900.woff +0 -0
- package/src/assets/fonts/fa/fa-solid-900.woff2 +0 -0
- package/src/assets/fonts/md/MaterialIcons-Regular.eot +0 -0
- package/src/assets/fonts/md/MaterialIcons-Regular.ijmap +1 -0
- package/src/assets/fonts/md/MaterialIcons-Regular.svg +2373 -0
- package/src/assets/fonts/md/MaterialIcons-Regular.ttf +0 -0
- package/src/assets/fonts/md/MaterialIcons-Regular.woff +0 -0
- package/src/assets/fonts/md/MaterialIcons-Regular.woff2 +0 -0
- package/src/assets/fonts/md/README.md +9 -0
- package/src/assets/fonts/md/codepoints +932 -0
- package/src/assets/fonts/md/material-icons.css +36 -0
- package/src/assets/fonts/octicon/octicon.eot +0 -0
- package/src/assets/fonts/octicon/octicon.svg +378 -0
- package/src/assets/fonts/octicon/octicon.ttf +0 -0
- package/src/assets/fonts/octicon/octicon.woff +0 -0
- package/src/assets/fonts/octicon/octicon.woff2 +0 -0
- package/src/assets/fonts/roboto/Roboto-Bold-webfont.eot +0 -0
- package/src/assets/fonts/roboto/Roboto-Bold-webfont.svg +607 -0
- package/src/assets/fonts/roboto/Roboto-Bold-webfont.ttf +0 -0
- package/src/assets/fonts/roboto/Roboto-Bold-webfont.woff +0 -0
- package/src/assets/fonts/roboto/Roboto-Medium-webfont.eot +0 -0
- package/src/assets/fonts/roboto/Roboto-Medium-webfont.svg +607 -0
- package/src/assets/fonts/roboto/Roboto-Medium-webfont.ttf +0 -0
- package/src/assets/fonts/roboto/Roboto-Medium-webfont.woff +0 -0
- package/src/assets/fonts/roboto/Roboto-Regular-webfont.eot +0 -0
- package/src/assets/fonts/roboto/Roboto-Regular-webfont.svg +635 -0
- package/src/assets/fonts/roboto/Roboto-Regular-webfont.ttf +0 -0
- package/src/assets/fonts/roboto/Roboto-Regular-webfont.woff +0 -0
- package/src/assets/i18n/en.json +12 -0
- package/src/assets/icons/android-chrome-192x192.png +0 -0
- package/src/assets/icons/android-chrome-512x512.png +0 -0
- package/src/assets/icons/apple-touch-icon.png +0 -0
- package/src/assets/icons/favicon-16x16.png +0 -0
- package/src/assets/icons/favicon-32x32.png +0 -0
- package/src/assets/icons/favicon.ico +0 -0
- package/src/assets/icons/site.webmanifest +1 -0
- package/src/assets/images/electron.bmp +0 -0
- package/src/bin/activator +0 -0
- package/src/bin/activator.exe +0 -0
- package/src/environments/environment.dev.ts +4 -0
- package/src/environments/environment.prod.ts +4 -0
- package/src/environments/environment.ts +4 -0
- package/src/environments/environment.web.prod.ts +4 -0
- package/src/environments/environment.web.ts +4 -0
- package/src/favicon.ico +0 -0
- package/src/index.html +55 -0
- package/src/karma.conf.js +50 -0
- package/src/main.ts +15 -0
- package/src/polyfills-test.ts +1 -0
- package/src/polyfills.ts +53 -0
- package/src/styles/base/loading.scss +87 -0
- package/src/styles/base/reset.scss +408 -0
- package/src/styles/components/alert.scss +54 -0
- package/src/styles/components/buttons.scss +93 -0
- package/src/styles/components/forms.scss +96 -0
- package/src/styles/components/inputs.scss +113 -0
- package/src/styles/components/modal.scss +52 -0
- package/src/styles/components/paginator.scss +108 -0
- package/src/styles/components/scrollbox.scss +71 -0
- package/src/styles/components/spinner.scss +11 -0
- package/src/styles/components/tables.scss +42 -0
- package/src/styles/components/tabs.scss +44 -0
- package/src/styles/components/toolbar.scss +130 -0
- package/src/styles/fonts/md.scss +54 -0
- package/src/styles/fonts/octicons.scss +1351 -0
- package/src/styles/fonts/roboto.scss +32 -0
- package/src/styles/themes/dashboard.scss +294 -0
- package/src/styles/themes/euphoria.scss +283 -0
- package/src/styles/themes/mellow.scss +280 -0
- package/src/styles/themes/midnight.scss +283 -0
- package/src/styles/themes/passion.scss +280 -0
- package/src/styles/themes/swiss.scss +283 -0
- package/src/styles/tools/_functions.scss +5 -0
- package/src/styles/tools/_mixins.scss +159 -0
- package/src/styles/tools/_placeholders.scss +17 -0
- package/src/styles/tools/_variables.scss +67 -0
- package/src/styles.scss +37 -0
- package/src/test.ts +22 -0
- package/src/tsconfig.app.json +20 -0
- package/src/tsconfig.spec.json +23 -0
- package/src/typings.d.ts +9 -0
- package/tailwind.config.js +67 -0
- package/tsconfig.json +42 -0
- package/tsconfig.serve.json +27 -0
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const electron_1 = require("electron");
|
|
4
|
+
class DarwinTemplate {
|
|
5
|
+
constructor(mainWindow, isProduction) {
|
|
6
|
+
this.mainWindow = mainWindow;
|
|
7
|
+
this.isProduction = isProduction;
|
|
8
|
+
}
|
|
9
|
+
build() {
|
|
10
|
+
const subMenuAbout = this.addSubMenuAbout();
|
|
11
|
+
const subMenuEdit = this.addSubMenuEdit();
|
|
12
|
+
const subMenuView = this.addSubMenuView();
|
|
13
|
+
const subMenuWindow = this.addSubMenuWindow();
|
|
14
|
+
const subMenuHelp = this.addSubMenuHelp();
|
|
15
|
+
return [subMenuAbout, subMenuEdit, subMenuView, subMenuWindow, subMenuHelp];
|
|
16
|
+
}
|
|
17
|
+
addSubMenuAbout() {
|
|
18
|
+
return {
|
|
19
|
+
label: 'Electron',
|
|
20
|
+
submenu: [
|
|
21
|
+
{
|
|
22
|
+
label: 'About ElectronReact',
|
|
23
|
+
selector: 'orderFrontStandardAboutPanel:',
|
|
24
|
+
},
|
|
25
|
+
{ type: 'separator' },
|
|
26
|
+
{ label: 'Services', submenu: [] },
|
|
27
|
+
{ type: 'separator' },
|
|
28
|
+
{
|
|
29
|
+
label: 'Hide ElectronReact',
|
|
30
|
+
accelerator: 'Command+H',
|
|
31
|
+
selector: 'hide:',
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
label: 'Hide Others',
|
|
35
|
+
accelerator: 'Command+Shift+H',
|
|
36
|
+
selector: 'hideOtherApplications:',
|
|
37
|
+
},
|
|
38
|
+
{ label: 'Show All', selector: 'unhideAllApplications:' },
|
|
39
|
+
{ type: 'separator' },
|
|
40
|
+
{
|
|
41
|
+
label: 'Quit',
|
|
42
|
+
accelerator: 'Command+Q',
|
|
43
|
+
click: () => {
|
|
44
|
+
electron_1.app.quit();
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
addSubMenuEdit() {
|
|
51
|
+
return {
|
|
52
|
+
label: 'Edit',
|
|
53
|
+
submenu: [
|
|
54
|
+
{ label: 'Undo', accelerator: 'Command+Z', selector: 'undo:' },
|
|
55
|
+
{ label: 'Redo', accelerator: 'Shift+Command+Z', selector: 'redo:' },
|
|
56
|
+
{ type: 'separator' },
|
|
57
|
+
{ label: 'Cut', accelerator: 'Command+X', selector: 'cut:' },
|
|
58
|
+
{ label: 'Copy', accelerator: 'Command+C', selector: 'copy:' },
|
|
59
|
+
{ label: 'Paste', accelerator: 'Command+V', selector: 'paste:' },
|
|
60
|
+
{ label: 'Select All', accelerator: 'Command+A', selector: 'selectAll:' }
|
|
61
|
+
],
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
addSubMenuView() {
|
|
65
|
+
return {
|
|
66
|
+
label: 'View',
|
|
67
|
+
submenu: [{
|
|
68
|
+
label: 'Reload',
|
|
69
|
+
accelerator: 'Command+R',
|
|
70
|
+
click: () => {
|
|
71
|
+
this.mainWindow.webContents.reload();
|
|
72
|
+
},
|
|
73
|
+
}, {
|
|
74
|
+
label: 'Toggle Full Screen',
|
|
75
|
+
accelerator: 'Ctrl+Command+F',
|
|
76
|
+
click: () => {
|
|
77
|
+
this.mainWindow.setFullScreen(!this.mainWindow.isFullScreen());
|
|
78
|
+
},
|
|
79
|
+
}, {
|
|
80
|
+
label: 'Toggle Developer Tools',
|
|
81
|
+
accelerator: 'Alt+Command+I',
|
|
82
|
+
click: () => {
|
|
83
|
+
this.mainWindow.webContents.toggleDevTools();
|
|
84
|
+
},
|
|
85
|
+
}]
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
addSubMenuWindow() {
|
|
89
|
+
return {
|
|
90
|
+
label: 'Window',
|
|
91
|
+
submenu: [
|
|
92
|
+
{ label: 'Minimize', accelerator: 'Command+M', selector: 'performMiniaturize:' },
|
|
93
|
+
{ label: 'Close', accelerator: 'Command+W', selector: 'performClose:' },
|
|
94
|
+
{ type: 'separator' },
|
|
95
|
+
{ label: 'Bring All to Front', selector: 'arrangeInFront:' },
|
|
96
|
+
]
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
addSubMenuHelp() {
|
|
100
|
+
return {
|
|
101
|
+
label: 'Help',
|
|
102
|
+
submenu: [{
|
|
103
|
+
label: 'Learn More',
|
|
104
|
+
click() {
|
|
105
|
+
electron_1.shell.openExternal('https://electronjs.org');
|
|
106
|
+
},
|
|
107
|
+
}, {
|
|
108
|
+
label: 'Documentation',
|
|
109
|
+
click() {
|
|
110
|
+
electron_1.shell.openExternal('https://github.com/electron/electron/tree/main/docs#readme');
|
|
111
|
+
},
|
|
112
|
+
}, {
|
|
113
|
+
label: 'Community Discussions',
|
|
114
|
+
click() {
|
|
115
|
+
electron_1.shell.openExternal('https://www.electronjs.org/community');
|
|
116
|
+
},
|
|
117
|
+
}, {
|
|
118
|
+
label: 'Search Issues',
|
|
119
|
+
click() {
|
|
120
|
+
electron_1.shell.openExternal('https://github.com/electron/electron/issues');
|
|
121
|
+
},
|
|
122
|
+
}]
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
exports.default = DarwinTemplate;
|
|
127
|
+
//# sourceMappingURL=DarwinTemplate.js.map
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { app, Menu, shell, BrowserWindow, MenuItemConstructorOptions } from 'electron';
|
|
2
|
+
|
|
3
|
+
interface DarwinMenuItemConstructorOptions extends MenuItemConstructorOptions {
|
|
4
|
+
selector?: string;
|
|
5
|
+
submenu?: DarwinMenuItemConstructorOptions[] | Menu;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export default class DarwinTemplate {
|
|
9
|
+
mainWindow: BrowserWindow;
|
|
10
|
+
isProduction: boolean;
|
|
11
|
+
|
|
12
|
+
constructor(mainWindow: BrowserWindow, isProduction: boolean) {
|
|
13
|
+
this.mainWindow = mainWindow;
|
|
14
|
+
this.isProduction = isProduction;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
build(): MenuItemConstructorOptions[] {
|
|
18
|
+
const subMenuAbout = this.addSubMenuAbout();
|
|
19
|
+
const subMenuEdit = this.addSubMenuEdit();
|
|
20
|
+
const subMenuView = this.addSubMenuView();
|
|
21
|
+
const subMenuWindow = this.addSubMenuWindow();
|
|
22
|
+
const subMenuHelp = this.addSubMenuHelp();
|
|
23
|
+
|
|
24
|
+
return [subMenuAbout, subMenuEdit, subMenuView, subMenuWindow, subMenuHelp];
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
addSubMenuAbout(): MenuItemConstructorOptions | DarwinMenuItemConstructorOptions {
|
|
28
|
+
return {
|
|
29
|
+
label: 'Electron',
|
|
30
|
+
submenu: [
|
|
31
|
+
{
|
|
32
|
+
label: 'About ElectronReact',
|
|
33
|
+
selector: 'orderFrontStandardAboutPanel:',
|
|
34
|
+
},
|
|
35
|
+
{ type: 'separator' },
|
|
36
|
+
{ label: 'Services', submenu: [] },
|
|
37
|
+
{ type: 'separator' },
|
|
38
|
+
{
|
|
39
|
+
label: 'Hide ElectronReact',
|
|
40
|
+
accelerator: 'Command+H',
|
|
41
|
+
selector: 'hide:',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
label: 'Hide Others',
|
|
45
|
+
accelerator: 'Command+Shift+H',
|
|
46
|
+
selector: 'hideOtherApplications:',
|
|
47
|
+
},
|
|
48
|
+
{ label: 'Show All', selector: 'unhideAllApplications:' },
|
|
49
|
+
{ type: 'separator' },
|
|
50
|
+
{
|
|
51
|
+
label: 'Quit',
|
|
52
|
+
accelerator: 'Command+Q',
|
|
53
|
+
click: () => {
|
|
54
|
+
app.quit();
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
addSubMenuEdit(): DarwinMenuItemConstructorOptions {
|
|
62
|
+
return {
|
|
63
|
+
label: 'Edit',
|
|
64
|
+
submenu: [
|
|
65
|
+
{ label: 'Undo', accelerator: 'Command+Z', selector: 'undo:' },
|
|
66
|
+
{ label: 'Redo', accelerator: 'Shift+Command+Z', selector: 'redo:' },
|
|
67
|
+
{ type: 'separator' },
|
|
68
|
+
{ label: 'Cut', accelerator: 'Command+X', selector: 'cut:' },
|
|
69
|
+
{ label: 'Copy', accelerator: 'Command+C', selector: 'copy:' },
|
|
70
|
+
{ label: 'Paste', accelerator: 'Command+V', selector: 'paste:' },
|
|
71
|
+
{ label: 'Select All', accelerator: 'Command+A', selector: 'selectAll:' }
|
|
72
|
+
],
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
addSubMenuView(): MenuItemConstructorOptions {
|
|
77
|
+
return {
|
|
78
|
+
label: 'View',
|
|
79
|
+
submenu: [{
|
|
80
|
+
label: 'Reload',
|
|
81
|
+
accelerator: 'Command+R',
|
|
82
|
+
click: () => {
|
|
83
|
+
this.mainWindow.webContents.reload();
|
|
84
|
+
},
|
|
85
|
+
}, {
|
|
86
|
+
label: 'Toggle Full Screen',
|
|
87
|
+
accelerator: 'Ctrl+Command+F',
|
|
88
|
+
click: () => {
|
|
89
|
+
this.mainWindow.setFullScreen(!this.mainWindow.isFullScreen());
|
|
90
|
+
},
|
|
91
|
+
}, {
|
|
92
|
+
label: 'Toggle Developer Tools',
|
|
93
|
+
accelerator: 'Alt+Command+I',
|
|
94
|
+
click: () => {
|
|
95
|
+
this.mainWindow.webContents.toggleDevTools();
|
|
96
|
+
},
|
|
97
|
+
}]
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
addSubMenuWindow(): DarwinMenuItemConstructorOptions {
|
|
102
|
+
return {
|
|
103
|
+
label: 'Window',
|
|
104
|
+
submenu: [
|
|
105
|
+
{ label: 'Minimize', accelerator: 'Command+M', selector: 'performMiniaturize:' },
|
|
106
|
+
{ label: 'Close', accelerator: 'Command+W', selector: 'performClose:' },
|
|
107
|
+
{ type: 'separator' },
|
|
108
|
+
{ label: 'Bring All to Front', selector: 'arrangeInFront:' },
|
|
109
|
+
]
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
addSubMenuHelp(): MenuItemConstructorOptions {
|
|
114
|
+
return {
|
|
115
|
+
label: 'Help',
|
|
116
|
+
submenu: [{
|
|
117
|
+
label: 'Learn More',
|
|
118
|
+
click() {
|
|
119
|
+
shell.openExternal('https://electronjs.org');
|
|
120
|
+
},
|
|
121
|
+
}, {
|
|
122
|
+
label: 'Documentation',
|
|
123
|
+
click() {
|
|
124
|
+
shell.openExternal(
|
|
125
|
+
'https://github.com/electron/electron/tree/main/docs#readme'
|
|
126
|
+
);
|
|
127
|
+
},
|
|
128
|
+
}, {
|
|
129
|
+
label: 'Community Discussions',
|
|
130
|
+
click() {
|
|
131
|
+
shell.openExternal('https://www.electronjs.org/community');
|
|
132
|
+
},
|
|
133
|
+
}, {
|
|
134
|
+
label: 'Search Issues',
|
|
135
|
+
click() {
|
|
136
|
+
shell.openExternal('https://github.com/electron/electron/issues');
|
|
137
|
+
},
|
|
138
|
+
}]
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const electron_1 = require("electron");
|
|
4
|
+
class SystemTemplate {
|
|
5
|
+
constructor(mainWindow, isProduction) {
|
|
6
|
+
this.mainWindow = mainWindow;
|
|
7
|
+
this.isProduction = isProduction;
|
|
8
|
+
}
|
|
9
|
+
build() {
|
|
10
|
+
const subMenuAbout = this.addSubMenuAbout();
|
|
11
|
+
const subMenuEdit = this.addSubMenuEdit();
|
|
12
|
+
const subMenuView = this.addSubMenuView();
|
|
13
|
+
const subMenuWindow = this.addSubMenuWindow();
|
|
14
|
+
const subMenuHelp = this.addSubMenuHelp();
|
|
15
|
+
return [subMenuAbout, subMenuEdit, subMenuView, subMenuWindow, subMenuHelp];
|
|
16
|
+
}
|
|
17
|
+
addSubMenuAbout() {
|
|
18
|
+
return {
|
|
19
|
+
label: 'Electron',
|
|
20
|
+
submenu: [{
|
|
21
|
+
label: 'About ElectronReact',
|
|
22
|
+
accelerator: 'Command+H'
|
|
23
|
+
},
|
|
24
|
+
{ type: 'separator' },
|
|
25
|
+
{ label: 'Services', submenu: [] },
|
|
26
|
+
{ type: 'separator' },
|
|
27
|
+
{
|
|
28
|
+
label: 'Hide ElectronReact',
|
|
29
|
+
accelerator: 'Command+H'
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
label: 'Hide Others',
|
|
33
|
+
accelerator: 'Command+Shift+H'
|
|
34
|
+
},
|
|
35
|
+
{ label: 'Show All' },
|
|
36
|
+
{ type: 'separator' },
|
|
37
|
+
{
|
|
38
|
+
label: 'Quit',
|
|
39
|
+
accelerator: 'Command+Q',
|
|
40
|
+
click: () => {
|
|
41
|
+
electron_1.app.quit();
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
addSubMenuEdit() {
|
|
48
|
+
return {
|
|
49
|
+
label: 'Edit',
|
|
50
|
+
submenu: [
|
|
51
|
+
{ label: 'Undo', accelerator: 'Command+Z' },
|
|
52
|
+
{ label: 'Redo', accelerator: 'Shift+Command+Z' },
|
|
53
|
+
{ type: 'separator' },
|
|
54
|
+
{ label: 'Cut', accelerator: 'Command+X' },
|
|
55
|
+
{ label: 'Copy', accelerator: 'Command+C' },
|
|
56
|
+
{ label: 'Paste', accelerator: 'Command+V' },
|
|
57
|
+
{ label: 'Select All', accelerator: 'Command+A' }
|
|
58
|
+
],
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
addSubMenuView() {
|
|
62
|
+
return {
|
|
63
|
+
label: 'View',
|
|
64
|
+
submenu: [{
|
|
65
|
+
label: 'Reload',
|
|
66
|
+
accelerator: 'Command+R',
|
|
67
|
+
click: () => {
|
|
68
|
+
this.mainWindow.webContents.reload();
|
|
69
|
+
},
|
|
70
|
+
}, {
|
|
71
|
+
label: 'Toggle Full Screen',
|
|
72
|
+
accelerator: 'Ctrl+Command+F',
|
|
73
|
+
click: () => {
|
|
74
|
+
this.mainWindow.setFullScreen(!this.mainWindow.isFullScreen());
|
|
75
|
+
},
|
|
76
|
+
}, {
|
|
77
|
+
label: 'Toggle Developer Tools',
|
|
78
|
+
accelerator: 'Alt+Command+I',
|
|
79
|
+
click: () => {
|
|
80
|
+
this.mainWindow.webContents.toggleDevTools();
|
|
81
|
+
},
|
|
82
|
+
}]
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
addSubMenuWindow() {
|
|
86
|
+
return {
|
|
87
|
+
label: 'Window',
|
|
88
|
+
submenu: [
|
|
89
|
+
{ label: 'Minimize', accelerator: 'Command+M' },
|
|
90
|
+
{ label: 'Close', accelerator: 'Command+W' },
|
|
91
|
+
{ type: 'separator' },
|
|
92
|
+
{ label: 'Bring All to Front' },
|
|
93
|
+
]
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
addSubMenuHelp() {
|
|
97
|
+
return {
|
|
98
|
+
label: 'Help',
|
|
99
|
+
submenu: [{
|
|
100
|
+
label: 'Learn More',
|
|
101
|
+
click() {
|
|
102
|
+
electron_1.shell.openExternal('https://electronjs.org');
|
|
103
|
+
},
|
|
104
|
+
}, {
|
|
105
|
+
label: 'Documentation',
|
|
106
|
+
click() {
|
|
107
|
+
electron_1.shell.openExternal('https://github.com/electron/electron/tree/main/docs#readme');
|
|
108
|
+
},
|
|
109
|
+
}, {
|
|
110
|
+
label: 'Community Discussions',
|
|
111
|
+
click() {
|
|
112
|
+
electron_1.shell.openExternal('https://www.electronjs.org/community');
|
|
113
|
+
},
|
|
114
|
+
}, {
|
|
115
|
+
label: 'Search Issues',
|
|
116
|
+
click() {
|
|
117
|
+
electron_1.shell.openExternal('https://github.com/electron/electron/issues');
|
|
118
|
+
},
|
|
119
|
+
}]
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
exports.default = SystemTemplate;
|
|
124
|
+
//# sourceMappingURL=SystemTemplate.js.map
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import {
|
|
2
|
+
app,
|
|
3
|
+
shell,
|
|
4
|
+
BrowserWindow,
|
|
5
|
+
MenuItemConstructorOptions,
|
|
6
|
+
} from 'electron';
|
|
7
|
+
|
|
8
|
+
export default class SystemTemplate {
|
|
9
|
+
mainWindow: BrowserWindow;
|
|
10
|
+
isProduction: boolean;
|
|
11
|
+
|
|
12
|
+
constructor(mainWindow: BrowserWindow, isProduction: boolean) {
|
|
13
|
+
this.mainWindow = mainWindow;
|
|
14
|
+
this.isProduction = isProduction;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
build(): MenuItemConstructorOptions[] {
|
|
18
|
+
const subMenuAbout = this.addSubMenuAbout();
|
|
19
|
+
const subMenuEdit = this.addSubMenuEdit();
|
|
20
|
+
const subMenuView = this.addSubMenuView();
|
|
21
|
+
const subMenuWindow = this.addSubMenuWindow();
|
|
22
|
+
const subMenuHelp = this.addSubMenuHelp();
|
|
23
|
+
|
|
24
|
+
return [subMenuAbout, subMenuEdit, subMenuView, subMenuWindow, subMenuHelp];
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
addSubMenuAbout(): MenuItemConstructorOptions {
|
|
28
|
+
return {
|
|
29
|
+
label: 'Electron',
|
|
30
|
+
submenu: [{
|
|
31
|
+
label: 'About ElectronReact',
|
|
32
|
+
accelerator: 'Command+H'
|
|
33
|
+
},
|
|
34
|
+
{ type: 'separator' },
|
|
35
|
+
{ label: 'Services', submenu: [] },
|
|
36
|
+
{ type: 'separator' },
|
|
37
|
+
{
|
|
38
|
+
label: 'Hide ElectronReact',
|
|
39
|
+
accelerator: 'Command+H'
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
label: 'Hide Others',
|
|
43
|
+
accelerator: 'Command+Shift+H'
|
|
44
|
+
},
|
|
45
|
+
{ label: 'Show All' },
|
|
46
|
+
{ type: 'separator' },
|
|
47
|
+
{
|
|
48
|
+
label: 'Quit',
|
|
49
|
+
accelerator: 'Command+Q',
|
|
50
|
+
click: () => {
|
|
51
|
+
app.quit();
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
addSubMenuEdit(): MenuItemConstructorOptions {
|
|
59
|
+
return {
|
|
60
|
+
label: 'Edit',
|
|
61
|
+
submenu: [
|
|
62
|
+
{ label: 'Undo', accelerator: 'Command+Z' },
|
|
63
|
+
{ label: 'Redo', accelerator: 'Shift+Command+Z' },
|
|
64
|
+
{ type: 'separator' },
|
|
65
|
+
{ label: 'Cut', accelerator: 'Command+X' },
|
|
66
|
+
{ label: 'Copy', accelerator: 'Command+C' },
|
|
67
|
+
{ label: 'Paste', accelerator: 'Command+V' },
|
|
68
|
+
{ label: 'Select All', accelerator: 'Command+A' }
|
|
69
|
+
],
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
addSubMenuView(): MenuItemConstructorOptions {
|
|
74
|
+
return {
|
|
75
|
+
label: 'View',
|
|
76
|
+
submenu: [{
|
|
77
|
+
label: 'Reload',
|
|
78
|
+
accelerator: 'Command+R',
|
|
79
|
+
click: () => {
|
|
80
|
+
this.mainWindow.webContents.reload();
|
|
81
|
+
},
|
|
82
|
+
}, {
|
|
83
|
+
label: 'Toggle Full Screen',
|
|
84
|
+
accelerator: 'Ctrl+Command+F',
|
|
85
|
+
click: () => {
|
|
86
|
+
this.mainWindow.setFullScreen(!this.mainWindow.isFullScreen());
|
|
87
|
+
},
|
|
88
|
+
}, {
|
|
89
|
+
label: 'Toggle Developer Tools',
|
|
90
|
+
accelerator: 'Alt+Command+I',
|
|
91
|
+
click: () => {
|
|
92
|
+
this.mainWindow.webContents.toggleDevTools();
|
|
93
|
+
},
|
|
94
|
+
}]
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
addSubMenuWindow(): MenuItemConstructorOptions {
|
|
99
|
+
return {
|
|
100
|
+
label: 'Window',
|
|
101
|
+
submenu: [
|
|
102
|
+
{ label: 'Minimize', accelerator: 'Command+M' },
|
|
103
|
+
{ label: 'Close', accelerator: 'Command+W' },
|
|
104
|
+
{ type: 'separator' },
|
|
105
|
+
{ label: 'Bring All to Front' },
|
|
106
|
+
]
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
addSubMenuHelp(): MenuItemConstructorOptions {
|
|
111
|
+
return {
|
|
112
|
+
label: 'Help',
|
|
113
|
+
submenu: [{
|
|
114
|
+
label: 'Learn More',
|
|
115
|
+
click() {
|
|
116
|
+
shell.openExternal('https://electronjs.org');
|
|
117
|
+
},
|
|
118
|
+
}, {
|
|
119
|
+
label: 'Documentation',
|
|
120
|
+
click() {
|
|
121
|
+
shell.openExternal(
|
|
122
|
+
'https://github.com/electron/electron/tree/main/docs#readme'
|
|
123
|
+
);
|
|
124
|
+
},
|
|
125
|
+
}, {
|
|
126
|
+
label: 'Community Discussions',
|
|
127
|
+
click() {
|
|
128
|
+
shell.openExternal('https://www.electronjs.org/community');
|
|
129
|
+
},
|
|
130
|
+
}, {
|
|
131
|
+
label: 'Search Issues',
|
|
132
|
+
click() {
|
|
133
|
+
shell.openExternal('https://github.com/electron/electron/issues');
|
|
134
|
+
},
|
|
135
|
+
}]
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.Collection = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const Store_schema_1 = require("./Store.schema");
|
|
15
|
+
let Collection = class Collection {
|
|
16
|
+
};
|
|
17
|
+
__decorate([
|
|
18
|
+
(0, typeorm_1.PrimaryGeneratedColumn)(),
|
|
19
|
+
__metadata("design:type", Number)
|
|
20
|
+
], Collection.prototype, "id", void 0);
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, typeorm_1.Column)({
|
|
23
|
+
length: 100
|
|
24
|
+
}),
|
|
25
|
+
__metadata("design:type", String)
|
|
26
|
+
], Collection.prototype, "title", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, typeorm_1.Column)({
|
|
29
|
+
type: "int",
|
|
30
|
+
default: 0
|
|
31
|
+
}),
|
|
32
|
+
__metadata("design:type", Number)
|
|
33
|
+
], Collection.prototype, "parent_id", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, typeorm_1.Column)({
|
|
36
|
+
type: "smallint",
|
|
37
|
+
default: 0
|
|
38
|
+
}),
|
|
39
|
+
__metadata("design:type", Number)
|
|
40
|
+
], Collection.prototype, "left_id", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, typeorm_1.Column)({
|
|
43
|
+
type: "smallint",
|
|
44
|
+
default: 0
|
|
45
|
+
}),
|
|
46
|
+
__metadata("design:type", Number)
|
|
47
|
+
], Collection.prototype, "right_id", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, typeorm_1.Column)({
|
|
50
|
+
type: "smallint",
|
|
51
|
+
default: 0
|
|
52
|
+
}),
|
|
53
|
+
__metadata("design:type", Number)
|
|
54
|
+
], Collection.prototype, "count", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, typeorm_1.Column)({
|
|
57
|
+
type: "smallint",
|
|
58
|
+
default: 0
|
|
59
|
+
}),
|
|
60
|
+
__metadata("design:type", Number)
|
|
61
|
+
], Collection.prototype, "is_system", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
(0, typeorm_1.Column)({
|
|
64
|
+
type: "smallint",
|
|
65
|
+
default: 0
|
|
66
|
+
}),
|
|
67
|
+
__metadata("design:type", Number)
|
|
68
|
+
], Collection.prototype, "orderby", void 0);
|
|
69
|
+
__decorate([
|
|
70
|
+
(0, typeorm_1.Column)({
|
|
71
|
+
type: "smallint",
|
|
72
|
+
default: 0
|
|
73
|
+
}),
|
|
74
|
+
__metadata("design:type", Boolean)
|
|
75
|
+
], Collection.prototype, "enabled", void 0);
|
|
76
|
+
__decorate([
|
|
77
|
+
(0, typeorm_1.Column)({
|
|
78
|
+
type: "smallint",
|
|
79
|
+
default: 0
|
|
80
|
+
}),
|
|
81
|
+
__metadata("design:type", Boolean)
|
|
82
|
+
], Collection.prototype, "collapsed", void 0);
|
|
83
|
+
__decorate([
|
|
84
|
+
(0, typeorm_1.CreateDateColumn)(),
|
|
85
|
+
__metadata("design:type", Date)
|
|
86
|
+
], Collection.prototype, "created", void 0);
|
|
87
|
+
__decorate([
|
|
88
|
+
(0, typeorm_1.UpdateDateColumn)(),
|
|
89
|
+
__metadata("design:type", Date)
|
|
90
|
+
], Collection.prototype, "updated", void 0);
|
|
91
|
+
__decorate([
|
|
92
|
+
(0, typeorm_1.OneToMany)(() => Store_schema_1.Store, (store) => store.collection, { cascade: true }),
|
|
93
|
+
__metadata("design:type", Array)
|
|
94
|
+
], Collection.prototype, "stores", void 0);
|
|
95
|
+
Collection = __decorate([
|
|
96
|
+
(0, typeorm_1.Entity)()
|
|
97
|
+
], Collection);
|
|
98
|
+
exports.Collection = Collection;
|
|
99
|
+
//# sourceMappingURL=Collection.schema.js.map
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { Entity, Column, PrimaryGeneratedColumn, CreateDateColumn, UpdateDateColumn, OneToMany } from "typeorm";
|
|
2
|
+
import { Store } from "./Store.schema"
|
|
3
|
+
|
|
4
|
+
@Entity()
|
|
5
|
+
export class Collection {
|
|
6
|
+
|
|
7
|
+
@PrimaryGeneratedColumn()
|
|
8
|
+
id: number;
|
|
9
|
+
|
|
10
|
+
@Column({
|
|
11
|
+
length: 100
|
|
12
|
+
})
|
|
13
|
+
title: string;
|
|
14
|
+
|
|
15
|
+
@Column({
|
|
16
|
+
type: "int",
|
|
17
|
+
default: 0
|
|
18
|
+
})
|
|
19
|
+
parent_id: number;
|
|
20
|
+
|
|
21
|
+
@Column({
|
|
22
|
+
type: "smallint",
|
|
23
|
+
default: 0
|
|
24
|
+
})
|
|
25
|
+
left_id: number;
|
|
26
|
+
|
|
27
|
+
@Column({
|
|
28
|
+
type: "smallint",
|
|
29
|
+
default: 0
|
|
30
|
+
})
|
|
31
|
+
right_id: number;
|
|
32
|
+
|
|
33
|
+
@Column({
|
|
34
|
+
type: "smallint",
|
|
35
|
+
default: 0
|
|
36
|
+
})
|
|
37
|
+
count: number;
|
|
38
|
+
|
|
39
|
+
@Column({
|
|
40
|
+
type: "smallint",
|
|
41
|
+
default: 0
|
|
42
|
+
})
|
|
43
|
+
is_system: number;
|
|
44
|
+
|
|
45
|
+
@Column({
|
|
46
|
+
type: "smallint",
|
|
47
|
+
default: 0
|
|
48
|
+
})
|
|
49
|
+
orderby: number;
|
|
50
|
+
|
|
51
|
+
@Column({
|
|
52
|
+
type: "smallint",
|
|
53
|
+
default: 0
|
|
54
|
+
})
|
|
55
|
+
enabled: boolean;
|
|
56
|
+
|
|
57
|
+
@Column({
|
|
58
|
+
type: "smallint",
|
|
59
|
+
default: 0
|
|
60
|
+
})
|
|
61
|
+
collapsed: boolean;
|
|
62
|
+
|
|
63
|
+
@CreateDateColumn() public created: Date;
|
|
64
|
+
@UpdateDateColumn() public updated: Date;
|
|
65
|
+
|
|
66
|
+
@OneToMany(() => Store, (store) => store.collection, { cascade: true })
|
|
67
|
+
stores: Store[]
|
|
68
|
+
}
|