kbot:extensions|docs|tests
4
packages/osr-code-bot/.gitignore
vendored
@ -23,15 +23,11 @@ types/
|
||||
# Logs
|
||||
*.Log
|
||||
*.Log.*
|
||||
docs
|
||||
docs-internal
|
||||
systems/code-server-defaults
|
||||
kbot-extensions
|
||||
systems/workspace/kbot-docs
|
||||
systems/.code-server/code-server-ipc.sock
|
||||
systems/.code-server/User/workspaceStorage/
|
||||
systems/code-server-defaults
|
||||
systems/.code-server
|
||||
|
||||
kbot-tests
|
||||
kbot-extensions
|
||||
|
||||
@ -0,0 +1 @@
|
||||
{}
|
||||
@ -0,0 +1 @@
|
||||
{}
|
||||
@ -0,0 +1 @@
|
||||
{}
|
||||
41
packages/osr-code-bot/docs/.frontmatter/starlight/aside.json
Normal file
@ -0,0 +1,41 @@
|
||||
{
|
||||
"$schema": "https://beta.frontmatter.codes/frontmatter.schema.json",
|
||||
"frontMatter.content.snippets": {
|
||||
"Aside": {
|
||||
"description": "Create an admonitions or callout",
|
||||
"body": [
|
||||
":::<<type>><<#label>>[<<label>>]<</label>>",
|
||||
"<<&content>>",
|
||||
":::"
|
||||
],
|
||||
"openingTags": "<<",
|
||||
"closingTags": ">>",
|
||||
"fields": [{
|
||||
"name": "type",
|
||||
"title": "type",
|
||||
"type": "choice",
|
||||
"choices": [
|
||||
"note",
|
||||
"tip",
|
||||
"caution",
|
||||
"danger"
|
||||
],
|
||||
"default": "note"
|
||||
},
|
||||
{
|
||||
"name": "label",
|
||||
"title": "label",
|
||||
"type": "string",
|
||||
"single": true
|
||||
},
|
||||
{
|
||||
"name": "content",
|
||||
"title": "content",
|
||||
"type": "string",
|
||||
"single": false,
|
||||
"default": "FM_SELECTED_TEXT"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,80 @@
|
||||
{
|
||||
"$schema": "https://beta.frontmatter.codes/frontmatter.schema.json",
|
||||
"frontMatter.taxonomy.contentTypes": [{
|
||||
"name": "default",
|
||||
"pageBundle": false,
|
||||
"previewPath": null,
|
||||
"filePrefix": null,
|
||||
"clearEmpty": true,
|
||||
"fields": [{
|
||||
"title": "Title",
|
||||
"name": "title",
|
||||
"type": "string",
|
||||
"single": true
|
||||
},
|
||||
{
|
||||
"title": "Description",
|
||||
"name": "description",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "divider",
|
||||
"type": "divider"
|
||||
},
|
||||
{
|
||||
"name": "heading",
|
||||
"title": "Optional configuration",
|
||||
"type": "heading"
|
||||
},
|
||||
{
|
||||
"title": "Edit URL",
|
||||
"name": "editUrl",
|
||||
"type": "string",
|
||||
"single": true
|
||||
},
|
||||
{
|
||||
"name": "banner",
|
||||
"title": "Banner",
|
||||
"type": "fields",
|
||||
"fields": [{
|
||||
"name": "content",
|
||||
"title": "Banner content",
|
||||
"type": "string"
|
||||
}]
|
||||
},
|
||||
{
|
||||
"name": "template",
|
||||
"title": "Page template",
|
||||
"type": "choice",
|
||||
"choices": [
|
||||
"doc",
|
||||
"splash"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "tableOfContents",
|
||||
"title": "Table of content settings",
|
||||
"type": "fields",
|
||||
"fields": [{
|
||||
"name": "minHeadingLevel",
|
||||
"title": "Minimum heading level",
|
||||
"type": "number",
|
||||
"numberOptions": {
|
||||
"min": 2,
|
||||
"max": 6
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "maxHeadingLevel",
|
||||
"title": "Maximum heading level",
|
||||
"type": "number",
|
||||
"numberOptions": {
|
||||
"min": 2,
|
||||
"max": 6
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}]
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
{
|
||||
"$schema": "https://beta.frontmatter.codes/frontmatter.schema.json",
|
||||
"frontMatter.content.pageFolders": [{
|
||||
"title": "Guides",
|
||||
"path": "[[workspace]]/src/content/docs/guides",
|
||||
"previewPath": "guides"
|
||||
},
|
||||
{
|
||||
"title": "References",
|
||||
"path": "[[workspace]]/src/content/docs/reference",
|
||||
"previewPath": "reference"
|
||||
}
|
||||
]
|
||||
}
|
||||
21
packages/osr-code-bot/docs/.gitignore
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
# build output
|
||||
dist/
|
||||
# generated types
|
||||
.astro/
|
||||
|
||||
# dependencies
|
||||
node_modules/
|
||||
|
||||
# logs
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
|
||||
|
||||
# environment variables
|
||||
.env
|
||||
.env.production
|
||||
|
||||
# macOS-specific files
|
||||
.DS_Store
|
||||
4
packages/osr-code-bot/docs/.vscode/extensions.json
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"recommendations": ["astro-build.astro-vscode"],
|
||||
"unwantedRecommendations": []
|
||||
}
|
||||
11
packages/osr-code-bot/docs/.vscode/launch.json
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"command": "./node_modules/.bin/astro dev",
|
||||
"name": "Development server",
|
||||
"request": "launch",
|
||||
"type": "node-terminal"
|
||||
}
|
||||
]
|
||||
}
|
||||
54
packages/osr-code-bot/docs/README.md
Normal file
@ -0,0 +1,54 @@
|
||||
# Starlight Starter Kit: Basics
|
||||
|
||||
[](https://starlight.astro.build)
|
||||
|
||||
```
|
||||
npm create astro@latest -- --template starlight
|
||||
```
|
||||
|
||||
[](https://stackblitz.com/github/withastro/starlight/tree/main/examples/basics)
|
||||
[](https://codesandbox.io/p/sandbox/github/withastro/starlight/tree/main/examples/basics)
|
||||
[](https://app.netlify.com/start/deploy?repository=https://github.com/withastro/starlight&create_from_path=examples/basics)
|
||||
[](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fwithastro%2Fstarlight%2Ftree%2Fmain%2Fexamples%2Fbasics&project-name=my-starlight-docs&repository-name=my-starlight-docs)
|
||||
|
||||
> 🧑🚀 **Seasoned astronaut?** Delete this file. Have fun!
|
||||
|
||||
## 🚀 Project Structure
|
||||
|
||||
Inside of your Astro + Starlight project, you'll see the following folders and files:
|
||||
|
||||
```
|
||||
.
|
||||
├── public/
|
||||
├── src/
|
||||
│ ├── assets/
|
||||
│ ├── content/
|
||||
│ │ ├── docs/
|
||||
│ └── content.config.ts
|
||||
├── astro.config.mjs
|
||||
├── package.json
|
||||
└── tsconfig.json
|
||||
```
|
||||
|
||||
Starlight looks for `.md` or `.mdx` files in the `src/content/docs/` directory. Each file is exposed as a route based on its file name.
|
||||
|
||||
Images can be added to `src/assets/` and embedded in Markdown with a relative link.
|
||||
|
||||
Static assets, like favicons, can be placed in the `public/` directory.
|
||||
|
||||
## 🧞 Commands
|
||||
|
||||
All commands are run from the root of the project, from a terminal:
|
||||
|
||||
| Command | Action |
|
||||
| :------------------------ | :----------------------------------------------- |
|
||||
| `npm install` | Installs dependencies |
|
||||
| `npm run dev` | Starts local dev server at `localhost:4321` |
|
||||
| `npm run build` | Build your production site to `./dist/` |
|
||||
| `npm run preview` | Preview your build locally, before deploying |
|
||||
| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |
|
||||
| `npm run astro -- --help` | Get help using the Astro CLI |
|
||||
|
||||
## 👀 Want to learn more?
|
||||
|
||||
Check out [Starlight’s docs](https://starlight.astro.build/), read [the Astro documentation](https://docs.astro.build), or jump into the [Astro Discord server](https://astro.build/chat).
|
||||
36
packages/osr-code-bot/docs/astro.config.mjs
Normal file
@ -0,0 +1,36 @@
|
||||
// @ts-check
|
||||
import { defineConfig } from 'astro/config';
|
||||
import starlight from '@astrojs/starlight';
|
||||
|
||||
// https://astro.build/config
|
||||
export default defineConfig({
|
||||
experimental: {
|
||||
// Disable the default Astro dev server
|
||||
// ssr: true,
|
||||
contentIntellisense: true,
|
||||
},
|
||||
compressHTML: true,
|
||||
integrations: [
|
||||
starlight({
|
||||
title: 'My Docs',
|
||||
social: {
|
||||
github: 'https://github.com/withastro/starlight',
|
||||
},
|
||||
sidebar: [
|
||||
{
|
||||
label: 'Guides',
|
||||
collapsed: false,
|
||||
items:
|
||||
[
|
||||
{ label: 'Example Guide', slug: 'guides/example' },
|
||||
],
|
||||
},
|
||||
{
|
||||
label: 'Meta',
|
||||
autogenerate: { directory: 'meta' },
|
||||
collapsed: true,
|
||||
},
|
||||
],
|
||||
}),
|
||||
],
|
||||
});
|
||||
450
packages/osr-code-bot/docs/config/_default/params.toml
Normal file
@ -0,0 +1,450 @@
|
||||
# If an option value is said to be not set, you can achieve the same behavior
|
||||
# by giving it an empty string value.
|
||||
|
||||
###############################################################################
|
||||
# Hugo
|
||||
# These options usually apply to other themes as well.
|
||||
|
||||
# The author of your site.
|
||||
# Default: not set
|
||||
# This will be used in HTML meta tags, the opengraph protocol and twitter
|
||||
# cards.
|
||||
# You can also set `author.email` if you want to publish this information.
|
||||
author.name = "PlasticHub"
|
||||
|
||||
# The social media image of your site.
|
||||
# Default: not set
|
||||
# This is used for generating social media meta information for the opengraph
|
||||
# protocol and twitter cards.
|
||||
# This can be overridden in the page's frontmatter.
|
||||
images = [ "images/hero.png" ]
|
||||
|
||||
# Admin options for social media.
|
||||
# Default: not set
|
||||
# Configuration for the Open Graph protocol and Twitter Cards adhere to Hugo's
|
||||
# implementation. See the Hugo docs for possible values.
|
||||
social.facebook_admin = ""
|
||||
social.twitter = ""
|
||||
|
||||
###############################################################################
|
||||
# Relearn Theme
|
||||
# These options are specific to the Relearn theme.
|
||||
|
||||
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
# Branding
|
||||
# These options set your overall visual appearance.
|
||||
|
||||
# Used color variants.
|
||||
# Default: "auto"
|
||||
# This sets one or more color variants, available to your readers to choose
|
||||
# from. You can
|
||||
# - set a single value eg. "zen-light"
|
||||
# - an array like [ "neon", "learn" ]
|
||||
# - an array with options like [ { identifier = "neon" },{ identifier = "learn" } ]
|
||||
# The last form allows to set further options for each variant.
|
||||
# The `identifier` is mandatory. You can also set `name` which overrides the
|
||||
# value displayed in the variant selector.
|
||||
# If the array has more than one entry, a variant selector
|
||||
# is shown in the lower part of the menu. The first entry in the array is the
|
||||
# default variant, used for first time visitors.
|
||||
# The theme ships with the following variants: "relearn-bright",
|
||||
# "relearn-light", "relearn-dark", "zen-light", "zen-dark", "neon", "learn",
|
||||
# "blue", "green", "red". In addition you can use auto mode variants. See the
|
||||
# docs for a detailed explanation.
|
||||
# You can also define your own variants. See the docs how this works. Also,
|
||||
# the docs provide an interactive theme generator to help you with this task.
|
||||
themeVariant = [
|
||||
{ identifier = "relearn-auto", name = "Relearn Light/Dark", auto = [] },
|
||||
{ identifier = "relearn-light" },
|
||||
{ identifier = "relearn-dark" },
|
||||
{ identifier = "relearn-bright" },
|
||||
{ identifier = "zen-auto", name = "Zen Light/Dark", auto = [ "zen-light", "zen-dark" ] },
|
||||
{ identifier = "zen-light" },
|
||||
{ identifier = "zen-dark" },
|
||||
{ identifier = "retro-auto", name = "Retro Learn/Neon", auto = [ "learn", "neon" ] },
|
||||
{ identifier = "neon" },
|
||||
{ identifier = "learn" },
|
||||
{ identifier = "blue" },
|
||||
{ identifier = "green" },
|
||||
{ identifier = "red" }
|
||||
]
|
||||
|
||||
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
# General
|
||||
# These options are defining general, non visual behavior.
|
||||
|
||||
# Avoid new asset URLs on build.
|
||||
# Default: false
|
||||
# By default JavaScript-files and CSS-files get a unique ID on each rebuild.
|
||||
# This makes sure, the user always has the latest version and not some stale
|
||||
# copy of his browser cache. Anyways, it can be desireable to turn this
|
||||
# off in certain circumstances. For example if you have Hugo's dev server
|
||||
# running. Also some proxies dislike this optimization.
|
||||
disableAssetsBusting = false
|
||||
|
||||
# Avoid generator meta tags.
|
||||
# Default: false
|
||||
# Set this to true if you want to disable generation for generator meta tags
|
||||
# of Hugo and the theme in your HTML head. In this case also don't forget to
|
||||
# set Hugo's disableHugoGeneratorInject=true. Otherwise Hugo will generate a
|
||||
# meta tag into your home page anyways.
|
||||
disableGeneratorVersion = false
|
||||
|
||||
# Avoid unique IDs.
|
||||
# Default: false
|
||||
# In various situations the theme generates non stable unique ids to be used
|
||||
# in HTML fragment links. This can be undesirable for example when testing
|
||||
# the output for changes. If you disable the random id generation, the theme
|
||||
# may not function correctly anymore.
|
||||
disableRandomIds = false
|
||||
|
||||
# Multilanguage content.
|
||||
# Default: not set
|
||||
# If your pages contain further languages besides the main one used, add all
|
||||
# those auxiliary languages here. This will create a search index with
|
||||
# support for all used languages of your site.
|
||||
# This is handy for example if you are writing in Spanish but have lots of
|
||||
# source code on your page which typically uses English terminology.
|
||||
additionalContentLanguage = [ "en" ]
|
||||
|
||||
# Additional code dependencies.
|
||||
# Default: See hugo.toml of the theme
|
||||
# The theme provides a mechanism to load further JavaScript and CSS
|
||||
# dependencies on demand only if they are needed. This comes in handy if you
|
||||
# want to add own shortcodes that depend on additional code to be loaded.
|
||||
# See the docs how this works.
|
||||
# [relearn.dependencies]
|
||||
|
||||
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
# Topbar
|
||||
# These options modify the topbar appearance.
|
||||
|
||||
# Hide the table of contents button.
|
||||
# Default: false
|
||||
# If the TOC button is hidden, also the keyboard shortcut is disabled.
|
||||
# This can be overridden in the page's frontmatter.
|
||||
disableToc = false
|
||||
|
||||
# Hide the breadcrumbs.
|
||||
# Default: false
|
||||
# If the breadcrumbs are hidden, the title of the displayed page will still be
|
||||
# shown in the topbar.
|
||||
disableBreadcrumb = false
|
||||
|
||||
# Hide Next and Previous navigation buttons.
|
||||
# Default: false
|
||||
# If the navigation buttons are hidden, also the keyboard shortcuts are
|
||||
# disabled.
|
||||
disableNextPrev = false
|
||||
|
||||
# The URL prefix to edit a page.
|
||||
# Default: not set
|
||||
# If set, an edit button will be shown in the topbar. If the button is hidden,
|
||||
# also the keyboard shortcuts are disabled. The value can contain the macro
|
||||
# `${FilePath}` which will be replaced by the file path of your displayed page.
|
||||
# If no `${FilePath}` is given in the value, the value is treated as if the
|
||||
# `${FilePath}` was appended at the end of the value. This can be overridden
|
||||
# in the pages frontmatter. This is useful if you want to give the opportunity
|
||||
# for people to create merge request for your content.
|
||||
editURL = "https://github.com/McShelby/hugo-theme-relearn/edit/main/exampleSite/content/${FilePath}"
|
||||
|
||||
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
# Menu
|
||||
# These options modify the menu appearance.
|
||||
|
||||
# Hide the search box.
|
||||
# Default: false
|
||||
# If the search box is disabled, the search functionality is disabled too.
|
||||
# This will also cause the keyboard shortcut to be disabled and the dedicated
|
||||
# search page is not linked although it mighty be configured.
|
||||
disableSearch = false
|
||||
|
||||
# Hide the Home entry.
|
||||
# Default: false
|
||||
# If shown, a Home button will appear below the search bar and the main menu.
|
||||
# It links to your the home page of the current language.
|
||||
disableLandingPageButton = true
|
||||
|
||||
# The order of main menu submenus.
|
||||
# Default: "weight"
|
||||
# Submenus can be ordered by "weight", "title", "linktitle", "modifieddate",
|
||||
# "expirydate", "publishdate", "date", "length" or "default" (adhering to
|
||||
# Hugo's default sort order). This can be overridden in the pages frontmatter.
|
||||
ordersectionsby = "weight"
|
||||
|
||||
# The initial expand state of submenus.
|
||||
# Default: not set
|
||||
# This controls whether submenus will be expanded (true), or collapsed (false)
|
||||
# in the menu. If not set, the first menu level is set to false, all others
|
||||
# levels are set to true. This can be overridden in the page's frontmatter.
|
||||
# If the displayed page has submenus, they will always been displayed expanded
|
||||
# regardless of this option.
|
||||
alwaysopen = ""
|
||||
|
||||
# Shows expander for submenus.
|
||||
# Default: false
|
||||
# If set to true, a submenu in the sidebar will be displayed in a collapsible
|
||||
# tree view and a clickable expander is set in front of the entry.
|
||||
# This can be overridden in the page's frontmatter.
|
||||
collapsibleMenu = true
|
||||
|
||||
# Shows checkmarks for visited pages of the main menu.
|
||||
# Default: false
|
||||
# This also causes the display of the `Clear History` entry in the lower part
|
||||
# of the menu to remove all checkmarks. The checkmarks will also been removed
|
||||
# if you regenerate your site as the ids are not stable.
|
||||
showVisitedLinks = true
|
||||
|
||||
# Hide heading above the shortcut menu.
|
||||
# Default: false
|
||||
# The title for the heading can be overwritten in your i18n files. See Hugo's
|
||||
# documentation how to do this.
|
||||
disableShortcutsTitle = false
|
||||
|
||||
# Hide the language switcher.
|
||||
# Default: false
|
||||
# If you have more than one language configured, a language switcher is
|
||||
# displayed in the lower part of the menu. This option lets you explicitly
|
||||
# turn this behavior off.
|
||||
disableLanguageSwitchingButton = false
|
||||
|
||||
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
# Hidden pages
|
||||
# These options configure how hidden pages are treated.
|
||||
# A page flagged as hidden, is only removed from the main menu if you are
|
||||
# currently not on this page or the hidden page is not part of current page's
|
||||
# ancestors. For all other functionality in Hugo a hidden page behaves like any
|
||||
# other page if not otherwise configured.
|
||||
|
||||
# Hide hidden pages from search.
|
||||
# Default: false
|
||||
# Hides hidden pages from the suggestions of the search box and the dedicated
|
||||
# search page.
|
||||
disableSearchHiddenPages = false
|
||||
|
||||
# Hide hidden pages for web crawlers.
|
||||
# Default: false
|
||||
# Avoids hidden pages from showing up in the sitemap and on Google (et all),
|
||||
# otherwise they may be indexed by search engines
|
||||
disableSeoHiddenPages = true
|
||||
|
||||
# Hide hidden pages for taxonomies.
|
||||
# Default: false
|
||||
# Hides hidden pages from showing up on the taxonomy and terms pages. If this
|
||||
# reduces term counters to zero, an empty but not linked term page will be
|
||||
# created anyhow.
|
||||
disableTagHiddenPages = false
|
||||
|
||||
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
# Content
|
||||
# These options modify how your content is displayed.
|
||||
|
||||
# Title separator.
|
||||
# Default: "::"
|
||||
# Changes the title separator used when concatenating the page title with the
|
||||
# site title. This is consistently used throughout the theme.
|
||||
titleSeparator = "::"
|
||||
|
||||
# Breadcrumb separator.
|
||||
# Default: ">"
|
||||
# Changes the breadcrumb separator used in the topbars breadcrumb area and for
|
||||
# search results and term pages.
|
||||
breadcrumbSeparator = ">"
|
||||
|
||||
# Hide the root breadcrumb.
|
||||
# Default: false
|
||||
# The root breadcrumb is usually the home page of your site. Because this is
|
||||
# always accessible by clicking on the logo, you may want to reduce clutter
|
||||
# by removing this from your breadcrumb.
|
||||
disableRootBreadcrumb = true
|
||||
|
||||
# Hide breadcrumbs term pages.
|
||||
# Default: false
|
||||
# If you have lots of taxonomy terms, the term pages may seem cluttered with
|
||||
# breadcrumbs to you, so this is the option to turn off breadcrumbs on term
|
||||
# pages. Only the page title will then be shown on the term pages.
|
||||
disableTermBreadcrumbs = false
|
||||
|
||||
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
# Highlight
|
||||
# These options configure how code is displayed.
|
||||
|
||||
# Hide copy-to-clipboard for inline code.
|
||||
# Default: false
|
||||
# This removes the copy-to-clipboard button from your inline code.
|
||||
disableInlineCopyToClipBoard = true
|
||||
|
||||
# Always show copy-to-clipboard for block code.
|
||||
# Default: false
|
||||
# The theme only shows the copy-to-clipboard button if you hover over the code
|
||||
# block. Set this to true to disable the hover effect and always show the
|
||||
# button.
|
||||
disableHoverBlockCopyToClipBoard = false
|
||||
|
||||
# Wrap for code blocks.
|
||||
# Default: true
|
||||
# By default lines of code blocks wrap around if the line is too long to be
|
||||
# displayed on screen. If you dislike this behavior, you can reconfigure it
|
||||
# here.
|
||||
# Note that lines always wrap in print mode regardless of this option.
|
||||
# This can be overridden in the page's frontmatter or given as a parameter to
|
||||
# individual code blocks.
|
||||
highlightWrap = true
|
||||
|
||||
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
# Include
|
||||
# These options configure how the include shortcode works.
|
||||
|
||||
# What to do when path is not resolved.
|
||||
# Default: ""
|
||||
# You can control what should happen if a path can not be resolved to as
|
||||
# a resource or via the file system. If not set, no output will be written
|
||||
# for the unresolved path. If set to `warning` the same happens and an additional
|
||||
# warning is printed. If set to `error` an error message is printed and the build
|
||||
# is aborted.
|
||||
include.errorlevel = ""
|
||||
|
||||
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
# Images
|
||||
# These options configure how images are displayed.
|
||||
|
||||
# What to do when local image link is not resolved.
|
||||
# Default: ""
|
||||
# You can control what should happen if a local image can not be resolved to as
|
||||
# a resource. If not set, the unresolved link is written as given into the resulting
|
||||
# output. If set to `warning` the same happens and an additional warning is
|
||||
# printed. If set to `error` an error message is printed and the build is
|
||||
# aborted.
|
||||
# Please note that this can not resolve files inside of your `static` directory.
|
||||
image.errorlevel = ""
|
||||
|
||||
# Image effects.
|
||||
# See the documentation for how you can even add your own arbitrary effects to
|
||||
# the list.
|
||||
# All effects can be overridden in the page's frontmatter or through URL parameter
|
||||
# given to the image. See the documentation for details.
|
||||
|
||||
# Default: false
|
||||
imageEffects.border = true
|
||||
# Default: true
|
||||
imageEffects.lazy = true
|
||||
# Default: true
|
||||
imageEffects.lightbox = true
|
||||
# Default: false
|
||||
imageEffects.shadow = false
|
||||
|
||||
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
# Links
|
||||
# These options configure how links are displayed.
|
||||
|
||||
# What to do when local page link is not resolved.
|
||||
# Default: ""
|
||||
# You can control what should happen if a local link can not be resolved to a
|
||||
# page. If not set, the unresolved link is written as given into the resulting
|
||||
# output. If set to `warning` the same happens and an additional warning is
|
||||
# printed. If set to `error` an error message is printed and the build is
|
||||
# aborted.
|
||||
# Please note that with Hugo < 0.123.0 + `uglyURLs=true` this can lead to false
|
||||
# negatives.
|
||||
link.errorlevel = ""
|
||||
|
||||
# How to open external links.
|
||||
# Default: "_blank"
|
||||
# For external links you can define how they are opened in your browser. All
|
||||
# values for the HTML `target` attribute of the `a` element are allowed. The
|
||||
# default value opens external links in a separate browser tab. If you want
|
||||
# to open those links in the same tab, use "_self".
|
||||
externalLinkTarget = "_self"
|
||||
|
||||
# Generate link URLs the Hugo way.
|
||||
# Default: false
|
||||
# If set to true, the theme behaves like a standard Hugo installation and
|
||||
# appends no index.html to prettyURLs. As a trade off, your build project will
|
||||
# not be servable from the file system.
|
||||
disableExplicitIndexURLs = false
|
||||
|
||||
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
# MathJax
|
||||
# These options configure how math formulae are displayed.
|
||||
|
||||
# Initialization options for MathJax.
|
||||
# Default: not set
|
||||
# A JSON value. See the MathJaxdocumentation for possible parameter.
|
||||
# This can be overridden in the page's frontmatter.
|
||||
mathJaxInitialize = "{}"
|
||||
|
||||
# Only load MathJax if needed.
|
||||
# Default: true
|
||||
# If a Math shortcode is found, the option will be ignored and
|
||||
# MathJax will be loaded regardlessly. The option is still useful in case you
|
||||
# are using scripting to set up your graph. In this case no shortcode or
|
||||
# codefence is involved and the library is not loaded by default. In this case
|
||||
# you can set `disableMathJax=false` in your frontmatter to force the library to
|
||||
# be loaded.
|
||||
# This can be overridden in the page's frontmatter.
|
||||
disableMathJax = true
|
||||
|
||||
# URL for external MathJax library.
|
||||
# Default: not set
|
||||
# Specifies the remote location of the MathJax library. By default the shipped
|
||||
# version will be used.
|
||||
# This can be overridden in the page's frontmatter.
|
||||
customMathJaxURL = "" # "https://unpkg.com/mathjax/es5/tex-mml-chtml.js"
|
||||
|
||||
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
# Mermaid
|
||||
# These options configure how Mermaid graphs are displayed.
|
||||
|
||||
# Make graphs panable and zoomable
|
||||
# Default: false
|
||||
# For huge graphs it can be helpful to make them zoomable. Zoomable graphs come
|
||||
# with a reset button for the zoom.
|
||||
# This can be overridden in the page's frontmatter or given as a parameter to
|
||||
# individual graphs.
|
||||
mermaidZoom = true
|
||||
|
||||
# Initialization options for Mermaid.
|
||||
# Default: not set
|
||||
# A JSON value. See the Mermaid documentation for possible parameter.
|
||||
# This can be overridden in the page's frontmatter.
|
||||
mermaidInitialize = "{ \"securityLevel\": \"loose\" }"
|
||||
|
||||
# Only load Mermaid if needed.
|
||||
# Default: true
|
||||
# If a Mermaid shortcode or codefence is found, the option will be ignored and
|
||||
# Mermaid will be loaded regardlessly. The option is still useful in case you
|
||||
# are using scripting to set up your graph. In this case no shortcode or
|
||||
# codefence is involved and the library is not loaded by default. In this case
|
||||
# you can set `disableMermaid=false` in your frontmatter to force the library to
|
||||
# be loaded.
|
||||
# This can be overridden in the page's frontmatter.
|
||||
disableMermaid = false
|
||||
|
||||
# URL for external Mermaid library.
|
||||
# Default: not set
|
||||
# Specifies the remote location of the Mermaid library. By default the shipped
|
||||
# version will be used.
|
||||
# This can be overridden in the page's frontmatter.
|
||||
customMermaidURL = "" # "https://unpkg.com/mermaid/dist/mermaid.min.js"
|
||||
|
||||
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
# OpenApi
|
||||
# These options configure how OpenAPI specifications are displayed.
|
||||
|
||||
# Only load OpenAPI if needed.
|
||||
# Default: true
|
||||
# If a OpenAPI shortcode is found, the option will be ignored and
|
||||
# OpenAPI will be loaded regardlessly. The option is still useful in case you
|
||||
# are using scripting to set up your graph. In this case no shortcode or
|
||||
# codefence is involved and the library is not loaded by default. In this case
|
||||
# you can set `disableOpenapi=false` in your frontmatter to force the library to
|
||||
# be loaded.
|
||||
# This can be overridden in the page's frontmatter.
|
||||
disableOpenapi = true
|
||||
|
||||
# URL for external OpenAPI library.
|
||||
# Default: not set
|
||||
# Specifies the remote location of the OpenAPI library. By default the shipped
|
||||
# version will be used.
|
||||
# This can be overridden in the page's frontmatter.
|
||||
customOpenapiURL = "" # "https://unpkg.com/swagger-ui-dist/swagger-ui-bundle.js"
|
||||
14
packages/osr-code-bot/docs/frontmatter.json
Normal file
@ -0,0 +1,14 @@
|
||||
{
|
||||
"$schema": "https://frontmatter.codes/frontmatter.schema.json",
|
||||
"frontMatter.framework.id": "astro",
|
||||
"frontMatter.preview.host": "http://localhost:4321",
|
||||
"frontMatter.content.publicFolder": {
|
||||
"path": "src/assets",
|
||||
"relative": true
|
||||
},
|
||||
"frontMatter.extends": [
|
||||
".frontmatter/starlight/contenttypes.json",
|
||||
".frontmatter/starlight/pagefolders.json",
|
||||
".frontmatter/starlight/aside.json"
|
||||
]
|
||||
}
|
||||
3
packages/osr-code-bot/docs/meta/README.md
Normal file
@ -0,0 +1,3 @@
|
||||
# osr-package-template
|
||||
|
||||
Package basics
|
||||
32
packages/osr-code-bot/docs/meta/_index.en.md
Normal file
@ -0,0 +1,32 @@
|
||||
+++
|
||||
archetype = "home"
|
||||
description = "Lydia - Printhead Documentation"
|
||||
title = "Lydia - Printhead Documentation"
|
||||
+++
|
||||
|
||||
|
||||
# Documentation
|
||||
|
||||
## Hardware
|
||||
|
||||
- [Setup Omron - MX2 & Omron E5DC Pids](./installation)
|
||||
|
||||
## Firmware
|
||||
|
||||
- [Controllino - Mega](../firmware/firmware_v2_cm/)
|
||||
- [Arduino-H7 Portenta (Work in Progress)](../firmware/firmware/)
|
||||
|
||||
## Modbus
|
||||
|
||||
- [TCP / RTU Interface](../modbus)
|
||||
- [Example TCP - VFD](../modbus/control_vfd)
|
||||
- [Example TCP - PIDs](../modbus/control_pid.md)
|
||||
- [Modbus Registers using Modbus-Poll](./Modbus-Poll.PNG)
|
||||
|
||||
## CAD
|
||||
|
||||
- [Main Design File - SM25 - Cidepa Motor](../designs/cad/Global-Kuga-V350-SM25-Init.SLDASM)
|
||||
|
||||
## Error Codes
|
||||
|
||||
- [Error Codes - Firmware](../modbus/_error-codes)
|
||||
39
packages/osr-code-bot/docs/meta/collaboration.md
Normal file
@ -0,0 +1,39 @@
|
||||
---
|
||||
title: "The Future of Collaboration A 10-Year Outlook"
|
||||
date: 2024-01-29
|
||||
draft: false
|
||||
tags: ["future", "content", "files", "annotations"]
|
||||
---
|
||||
## The Future of Collaboration
|
||||
|
||||
The evolution of content creation and consumption is set to become increasingly collaborative, moving beyond solitary endeavors to foster community-driven innovation and productivity. This transformation is supported by a range of tools and technologies designed to enhance collaborative efforts across various platforms.
|
||||
|
||||
### Real-Time Co-Editing
|
||||
|
||||
One of the key advancements in collaboration will be the ability for multiple users to seamlessly edit documents in real time. This feature, already being refined by platforms like [Google Docs](https://www.google.com/docs/about/) and [Microsoft Office 365](https://www.office.com/), minimizes barriers to teamwork and boosts efficiency by enabling contributors to see and respond to each other's changes instantly. The co-editing capability is augmented by features like version history and revision tracking, which provide transparency and accountability.
|
||||
|
||||
### Contextual Awareness
|
||||
|
||||
As collaborators engage with shared content, systems will provide them with insights into others' modifications without overwhelming them with information. Applications such as [Slack](https://slack.com/) and [Microsoft Teams](https://www.microsoft.com/en-us/microsoft-teams/group-chat-software) are developing features that highlight relevant changes and comments within the context of ongoing projects. This capability ensures a synchronized understanding across teams and reduces the potential for conflicts arising from miscommunication.
|
||||
|
||||
### Automated Synchronization
|
||||
|
||||
Future workflows will increasingly depend on automated synchronization across platforms and devices. Services like [Dropbox](https://www.dropbox.com/) and [OneDrive](https://onedrive.live.com/) are already facilitating this by ensuring that the latest versions of content are accessible from any location or device. As this synchronization becomes more seamless, users will benefit from uninterrupted access to updated information, regardless of their active device.
|
||||
|
||||
### Intelligent Conflict Resolution
|
||||
|
||||
Artificial Intelligence will play a crucial role in managing collaborative spaces by offering solutions for resolving conflicts that arise from simultaneous content modifications. Tools such as [Atlassian Confluence](https://www.atlassian.com/software/confluence) are beginning to integrate AI-driven suggestions for managing these conflicts, providing users with merge suggestions or automated conflict resolution options. This eases user interaction and helps maintain content integrity while supporting fluid collaboration.
|
||||
|
||||
### Project Management Integration
|
||||
|
||||
Collaboration in content creation is further enhanced by integration with project management tools that align with team workflows. Platforms like [Asana](https://asana.com/) and [Trello](https://trello.com/) offer functionalities where content collaboration can be managed alongside task assignments, deadlines, and progress tracking. These integrations help teams stay organized, ensure accountability, and streamline project delivery by tying collaborative content efforts directly to broader project goals.
|
||||
|
||||
### Open Collaboration and Contribution Models
|
||||
|
||||
The future of collaboration is also leaning towards openness, where content creation taps into wider community inputs. Platforms such as [GitHub](https://github.com/) exemplify this trend by allowing open contributions to have structured peer reviews and collaborative improvements. This model not only enhances the quality of output through diverse insights but also accelerates innovation by pooling a wider range of expertise and creativity.
|
||||
|
||||
### Collaborative Learning and Knowledge Sharing
|
||||
|
||||
As more integrated collaboration tools emerge, they will promote knowledge sharing and continuous learning within and across organizations. Platforms like [Notion](https://www.notion.so/) and [Confluence](https://www.atlassian.com/software/confluence) are creating collaborative spaces where users can share knowledge, create wikis, and build living documents that evolve with team input. These tools facilitate a culture of learning and adaptation, ensuring that information sharing becomes an integral part of the collaborative process.
|
||||
|
||||
By leveraging these collaborative advancements, organizations can break down silos, encourage innovation, and build dynamic content ecosystems that are adaptable, intuitive, and reflective of collective intelligence. This shift will be crucial to meet the demands of an increasingly interconnected and collaborative digital world.
|
||||
95
packages/osr-code-bot/docs/meta/files.md
Normal file
@ -0,0 +1,95 @@
|
||||
---
|
||||
title: "The Future of Files and Content: A 10-Year Outlook"
|
||||
date: 2024-01-29
|
||||
draft: false
|
||||
tags: ["future", "content", "files", "annotations"]
|
||||
---
|
||||
|
||||
## The Evolving Nature of Files and Content
|
||||
|
||||
As we look toward the next decade, the concept of "files" as we know them is poised for a dramatic transformation. The traditional notion of discrete, self-contained units of data is evolving into something far more fluid, contextual, and interconnected. This evolution is driven by advancements in technology, changing user expectations, and the increasing complexity of information ecosystems.
|
||||
|
||||
Files have historically been defined by their boundaries—specific containers of data isolated by format, location, and context. However, as technology progresses, this rigid structure is being dismantled in favor of more dynamic and flexible data models. Future files will encapsulate content that seamlessly integrates across applications, platforms, and devices, allowing for a more cohesive digital experience.
|
||||
|
||||
The shift is not just technical but conceptual, as it reflects a broader understanding of information management. In practice, this means transcending the limitations of traditional file systems to embrace structures that prioritize user context, behavioral insights, and multidimensional data relationships.
|
||||
|
||||
## The Decline of Traditional File Systems
|
||||
|
||||
In the coming years, we'll likely see a gradual shift away from traditional hierarchical file systems. The rigid tree-like structures of directories and folders will give way to more advanced systems optimized for accessibility and adaptability, emphasizing content's intrinsic value over its mere location. Here are key elements of this transformation:
|
||||
|
||||
- **Content-Centric Storage**: Future storage architectures will prioritize the meaning and context of information. By classifying data based on its inherent properties and usage patterns rather than its physical location, users can retrieve and interact with content based on relevance. This approach leverages metadata, semantic analysis, and user habits to create intuitive and personalized storage environments.
|
||||
|
||||
- **Fluid Documents**: The concept of documents is expanding to encompass living, evolving entities that can exist in multiple states and versions simultaneously. These documents will not be tied to a single format or static representation but will adapt fluidly to the context in which they are accessed, offering users the most pertinent and updated view at any moment.
|
||||
|
||||
- **Dynamic Composition**: With dynamic composition, content can assemble itself from various sources in real-time, tailored to specific user needs or contextual triggers. This capability transforms the static consumption of information into a continuously adaptable and interactive experience, ensuring that users receive the most relevant and complete narrative.
|
||||
|
||||
## The Rise of Intelligent Annotations
|
||||
|
||||
One of the most significant developments in the next decade will be the evolution of annotations. No longer confined to the margins or attached in static form, annotations will become integral to digital content, offering layers of intelligence, interactivity, and customization.
|
||||
|
||||
### 1. Contextually Aware
|
||||
|
||||
Annotations will transcend simple text notes, evolving into systems that understand and interact with their environment. They will:
|
||||
|
||||
- Analyze relationships not only with the underlying content but also with other annotations and external data sources. This interconnectedness will enable richer narratives and insights derived from a web of contextually relevant information.
|
||||
- Integrate with user behavior and preferences to provide personalized experiences. By learning from user interactions and historical data, annotations will adapt their presentation and functionality to align with individual needs and expectations, enhancing user engagement.
|
||||
|
||||
### 2. Interactive and Dynamic
|
||||
|
||||
The transformation of annotations will see them evolve from static marks to complex, interactive ecosystems. Future annotations will:
|
||||
|
||||
- Act as interactive layers that provide deeper insights or auxiliary content upon engagement. They transform a document into an exploratory landscape, whereby users can uncover supplementary data or functionality as needed.
|
||||
- Update dynamically to reflect new information, ensuring that annotations and the content they enhance remain current and accurate. AI-driven mechanisms can automatically incorporate updates or revisions pertinent to the annotation context.
|
||||
|
||||
- Spur collaboration by serving as arenas for discussion and idea exchange. Annotations will support real-time collaboration, allowing multiple users to contribute, comment, and modify information within a shared digital space.
|
||||
|
||||
### 3. Semantically Rich Metadata
|
||||
|
||||
Annotations, enriched with semantics, will become pivotal to understanding content in depth. They will:
|
||||
|
||||
- Encode structured data that artificial intelligence systems can process, enabling advanced analysis and inference. This will enhance machine understanding of content contexts and relationships, facilitating more effective automation and decision-making processes.
|
||||
- Establish links to related concepts and resources, building rich networks of content that offer diverse perspectives and supplemental information.
|
||||
|
||||
- Include comprehensive version history and provenance details to ensure transparency and accountability. Users will be able to trace the evolution of annotations and their impacts on the primary content.
|
||||
|
||||
- Carry contextual metadata that describes usage patterns, relevancy, and interaction history, enabling future systems to fine-tune experiences based on aggregated insights.
|
||||
|
||||
## The Future of Collaboration
|
||||
|
||||
Content creation and consumption will become increasingly collaborative, moving beyond isolated experiences to foster community-driven innovation and productivity.
|
||||
|
||||
- **Real-Time Co-Editing**: Future collaborative processes will benefit from seamless and simultaneous multi-user editing capabilities. This real-time interaction will reduce barriers to teamwork and increase efficiency, allowing contributors to see and respond to changes instantly.
|
||||
|
||||
- **Contextual Awareness**: As collaborators work on shared content, systems will provide awareness of others' modifications without overwhelming users. This will create a synchronized understanding across teams and minimize conflicts by highlighting relevant changes and comments in context.
|
||||
|
||||
- **Automated Synchronization**: Professional and personal workflows will increasingly rely on automated, cross-platform synchronization. Data will migrate fluidly across devices—ensuring that users have access to the latest versions of content regardless of their active device or location.
|
||||
|
||||
- **Intelligent Conflict Resolution**: AI will mediate collaborative spaces, providing smart solutions to resolve conflicts that arise from simultaneous content modifications. These systems will offer conflict suggestions or merge decisions, simplifying user interaction and maintaining content integrity.
|
||||
|
||||
## The Role of AI in Content Management
|
||||
|
||||
Artificial Intelligence will be pivotal in revolutionizing content management systems, offering capabilities that enhance organizational efficiency, user experience, and adaptability.
|
||||
|
||||
1. **Content Organization**
|
||||
- AI systems will autonomously categorize content by analyzing its semantic properties, usage patterns, and potential relationships, streamlining how information is stored and retrieved.
|
||||
- Intelligent tagging will replace manual labelings, such that content is associated with context-aware tags automatically assigned by understanding content semantics and usage context.
|
||||
- Contextual search mechanisms will leverage AI to anticipate user intentions and present the most relevant results quickly, charitably synthesizing user needs and search history.
|
||||
|
||||
2. **Content Generation**
|
||||
- Automated summarization tools will enable users to distill vast amounts of information into concise, insightful overviews, facilitating faster understanding and decision-making.
|
||||
- Systems will analyze content contexts to offer suggestions or enhancements tailored to user objectives and situational demands.
|
||||
- Dynamic content adaptation will adjust narratives or presentations based on real-time factors such as audience, platform, and device preferences.
|
||||
|
||||
## Privacy and Security Considerations
|
||||
|
||||
As content becomes more interconnected, new challenges will emerge that necessitate innovative solutions to safeguard user privacy and content integrity.
|
||||
|
||||
- **Granular Access Control**: Future systems will need robust access management tools to define user permissions at more granular levels, ensuring that different content aspects are accessible according to precise security roles and protocols.
|
||||
|
||||
- **Encrypted Annotations**: Annotations will incorporate cryptographic measures to secure data while allowing authorized collaboration. This encryption ensures privacy while maintaining the flexibility of sharing and editing within trusted communities.
|
||||
|
||||
- **Blockchain-Based Verification**: Content authenticity and integrity will be enhanced through blockchain technology, offering decentralized and tamper-proof means to verify information provenance and historical modifications, increasing trust in digital content.
|
||||
|
||||
## Conclusion
|
||||
|
||||
The next decade will see a fundamental rethinking of how we create, store, and interact with content. The future of files lies not in their traditional, static form, but in a more dynamic, interconnected, and intelligent ecosystem of information. This vision is underpinned by the transformative role of intelligent annotations, AI-driven content management, and evolving paradigms that prioritize meaning, context, and collaboration. By embracing these changes, we can unlock deeper insights, nurture innovation, and foster richer digital experiences that keep pace with an ever-changing world.
|
||||
71
packages/osr-code-bot/docs/meta/future-deep.md
Normal file
@ -0,0 +1,71 @@
|
||||
Predicting the future of humanity over the next 10 years involves considering current trends, technological advancements, geopolitical dynamics, and environmental challenges. Here’s a forecast based on plausible trajectories:
|
||||
|
||||
|
||||
### **1. Technological Advancements**
|
||||
- **Artificial Intelligence (AI):** AI will become deeply integrated into daily life, transforming industries like healthcare, education, and transportation. Ethical concerns and regulations around AI will grow.
|
||||
- **Quantum Computing:** Early-stage quantum computers may solve complex problems in fields like cryptography, materials science, and drug discovery.
|
||||
- **Biotechnology:** Advances in gene editing (e.g., CRISPR) and personalized medicine will revolutionize healthcare, potentially curing genetic diseases and extending lifespans.
|
||||
- **Space Exploration:** Private companies and governments will expand space exploration, with missions to the Moon, Mars, and beyond. Space tourism may become more accessible.
|
||||
|
||||
---
|
||||
|
||||
### **2. Climate Change and Sustainability**
|
||||
- **Climate Crisis:** The effects of climate change will intensify, with more frequent extreme weather events, rising sea levels, and biodiversity loss. Global efforts to mitigate these impacts will accelerate.
|
||||
- **Renewable Energy:** Solar, wind, and other renewable energy sources will dominate new energy investments, reducing reliance on fossil fuels.
|
||||
- **Circular Economy:** Sustainable practices and circular economy models will gain traction, reducing waste and promoting resource efficiency.
|
||||
|
||||
---
|
||||
|
||||
### **3. Geopolitical Shifts**
|
||||
- **Power Dynamics:** The U.S., China, and the EU will remain major global powers, but emerging economies like India and Brazil will play larger roles in international affairs.
|
||||
- **Conflict and Cooperation:** Tensions over resources, technology, and territorial disputes may rise, but global cooperation on issues like climate change and pandemics will also increase.
|
||||
- **Globalization vs. Localization:** The world may see a balance between globalization and localization, with countries focusing on self-sufficiency in critical areas like food and energy.
|
||||
|
||||
---
|
||||
|
||||
### **4. Social and Cultural Changes**
|
||||
- **Demographics:** Aging populations in developed countries and youth bulges in developing nations will shape economic and social policies.
|
||||
- **Work and Automation:** Automation will disrupt traditional jobs, leading to shifts in the workforce and the rise of new industries. Universal Basic Income (UBI) may be tested in more countries.
|
||||
- **Inequality:** Economic inequality could widen, but social movements and policies may address disparities in wealth, education, and healthcare.
|
||||
|
||||
---
|
||||
|
||||
### **5. Health and Well-being**
|
||||
- **Pandemic Preparedness:** Lessons from COVID-19 will lead to better global health infrastructure and faster responses to future pandemics.
|
||||
- **Mental Health:** Awareness and treatment of mental health issues will improve, driven by technology and societal acceptance.
|
||||
- **Longevity:** Advances in medicine and lifestyle changes will increase life expectancy, but aging populations will pose challenges for healthcare systems.
|
||||
|
||||
---
|
||||
|
||||
### **6. Environmental and Ethical Challenges**
|
||||
- **Biodiversity Loss:** Efforts to protect endangered species and ecosystems will intensify, but habitat destruction and climate change will remain threats.
|
||||
- **Ethical Dilemmas:** Debates over AI ethics, genetic engineering, and data privacy will shape policies and societal norms.
|
||||
|
||||
---
|
||||
|
||||
### **7. Global Connectivity**
|
||||
- **Digital Divide:** Efforts to bridge the digital divide will expand internet access to underserved regions, empowering communities and driving economic growth.
|
||||
- **Virtual Reality (VR) and Augmented Reality (AR):** These technologies will transform entertainment, education, and remote work, creating new opportunities and challenges.
|
||||
|
||||
---
|
||||
|
||||
### **8. Cultural Evolution**
|
||||
- **Diversity and Inclusion:** Movements for racial, gender, and social equality will continue to shape societies, leading to more inclusive policies and practices.
|
||||
- **Global Culture:** The blending of cultures through technology and migration will create a more interconnected and diverse global society.
|
||||
|
||||
---
|
||||
|
||||
### **9. Economic Trends**
|
||||
- **Green Economy:** Investments in sustainable industries will drive economic growth, creating new jobs and opportunities.
|
||||
- **Cryptocurrency and Blockchain:** Digital currencies and blockchain technology will gain wider acceptance, potentially transforming financial systems.
|
||||
|
||||
---
|
||||
|
||||
### **10. Existential Risks**
|
||||
- **Nuclear Threats:** Geopolitical tensions could increase the risk of nuclear conflict, though disarmament efforts may mitigate this.
|
||||
- **AI and Biosecurity:** The misuse of AI and biotechnology could pose significant risks, requiring robust governance and international cooperation.
|
||||
|
||||
---
|
||||
|
||||
### **Conclusion**
|
||||
The next 10 years will likely be a period of rapid change, marked by both challenges and opportunities. Humanity’s ability to address global issues like climate change, inequality, and technological disruption will determine the trajectory of our future. Collaboration, innovation, and ethical leadership will be critical in shaping a sustainable and equitable world.
|
||||
34
packages/osr-code-bot/docs/meta/future-gemini.md
Normal file
@ -0,0 +1,34 @@
|
||||
## Forecasting Humanity in 10 Years (2033): A Glimpse into the Future
|
||||
|
||||
Forecasting the future is a complex exercise, but by analyzing current trends and emerging technologies, we can create a plausible scenario for humanity in 10 years.
|
||||
|
||||
**1. Technological Advancements:**
|
||||
|
||||
* **Artificial Intelligence (AI) Pervasiveness:** AI will be deeply integrated into daily life, automating tasks, personalizing experiences, and driving innovation across industries like healthcare, finance, and transportation. Expect more sophisticated AI assistants, personalized medicine, and autonomous vehicles.
|
||||
* **Ubiquitous Connectivity:** The Internet of Things (IoT) will expand, connecting billions of devices and creating smart homes, cities, and industries. This hyper-connectivity will improve efficiency, resource management, and convenience.
|
||||
* **Biotechnology and Gene Editing:** Advancements in gene editing technologies like CRISPR will likely lead to breakthroughs in disease treatment and prevention, potentially revolutionizing healthcare. Ethical debates around genetic modification will continue.
|
||||
* **Sustainable Technologies:** The urgency of climate change will accelerate the development and adoption of renewable energy sources, energy storage solutions, and sustainable agriculture practices.
|
||||
* **Space Exploration:** Commercial space travel will become more common, with potential for space tourism and resource extraction. Space agencies will continue exploring Mars and other celestial bodies.
|
||||
|
||||
**2. Societal Shifts:**
|
||||
|
||||
* **Demographic Changes:** The global population will continue to age, leading to challenges and opportunities in healthcare, social security, and workforce dynamics.
|
||||
* **Urbanization:** Cities will continue to grow, demanding innovative solutions for housing, transportation, and resource management. Smart city initiatives will gain traction.
|
||||
* **Changing Work Landscape:** Automation and AI will reshape the job market, requiring workers to adapt and acquire new skills. The gig economy and remote work will likely become even more prevalent.
|
||||
* **Increased Social Awareness:** Social movements advocating for equality, inclusivity, and environmental protection will likely gain momentum, influencing policy and corporate behavior.
|
||||
* **Geopolitical Landscape:** Global power dynamics will continue to shift, with potential for new alliances and collaborations, as well as increased competition in areas like technology and resources.
|
||||
|
||||
**3. Potential Challenges:**
|
||||
|
||||
* **Climate Change Impacts:** Extreme weather events, rising sea levels, and resource scarcity will pose significant challenges to communities and economies worldwide.
|
||||
* **Cybersecurity Threats:** With increased connectivity and reliance on technology, cybersecurity threats will become more sophisticated, demanding robust defenses and international cooperation.
|
||||
* **Social Inequality:** The benefits of technological advancements may not be evenly distributed, leading to a widening gap in wealth and opportunity if not addressed proactively.
|
||||
* **Ethical Dilemmas:** The rapid pace of technological change will raise ethical dilemmas related to AI, gene editing, data privacy, and automation, requiring careful consideration and regulation.
|
||||
|
||||
|
||||
**Conclusion:**
|
||||
|
||||
The next 10 years promise exciting advancements and transformative changes across various aspects of human life. However, navigating the challenges and ensuring a sustainable and equitable future will require collaboration, innovation, and responsible stewardship of technology and resources.
|
||||
|
||||
|
||||
**Disclaimer:** This is a speculative forecast based on current trends and expert predictions. Unforeseen events and breakthroughs could significantly alter the trajectory of human development.
|
||||
27
packages/osr-code-bot/docs/meta/future-meta.md
Normal file
@ -0,0 +1,27 @@
|
||||
**Systemic Analysis and Forecast for Humanity over the Next 10 Years (2023-2033)**
|
||||
|
||||
This assessment considers various factors affecting humanity, such as technological advancements, environmental shifts, economic trends, and social transformations. The forecast provided here is based on patterns and predictions observed within the realm of known technological, sociological, and environmental data up to early 2023.
|
||||
|
||||
**Economic Trends:**
|
||||
|
||||
1. **Global Debt Crisis**: Increased global debt levels, accompanied by rising interest rates and stagnant economic growth, might trigger a crisis, leading to potential global recession or another financial crisis within critical economic sectors by the end of 2030.
|
||||
2. **Accelerated Digital Transformation**: The global shift towards a digital economy is expected to continue at an unprecedented rate, placing companies that fail to adapt at significant risk. This shift towards a digital first world will significantly boost economic growth but equally exacerbate income inequality.
|
||||
3. **The Rise of Emerging Markets**: Continuation of emerging markets growth in Asia, India, and elsewhere will challenge the world order by giving them significant political and economic influence.
|
||||
|
||||
**Technological Advancements:**
|
||||
|
||||
1. **Advancements in Renewable Energy**: Expectations are that the push towards renewable energy sources will accelerate over the next decade, driven in large part by non-governmental organizations (NGOs) and international endeavors.
|
||||
2. **Enhanced AI Integration**: As the pace of AI development rapid, widespread adoption of AI technologies into daily lives leading to workforce transformation and the blurring of traditional division between humans and machines.
|
||||
3. **Quantum Computing Breakthroughs**: By 2030, breakthroughs in quantum computing will become evident, further advancing compute power while significantly changing every frontier, impacting societal architecture, including economic systems.
|
||||
|
||||
**Environmental Shifts:**
|
||||
|
||||
1. **Accelerated Climate Change**: Despite mitigation efforts, the probability of experiencing another year as in 2022 (i.e., one of the three hottest years on record) necessitates significant immediate action and potentially global commitments to adhere to and amplify environmental objectives,
|
||||
2. **Water Resource Challenges**: Continuing drying trends in the Middle East, coupled with significant risks of drought due to climate change, suggest that water will become an area of human sustainment focus.
|
||||
3. **Massive Migration and Conflict**: Under current projections, significantly more influences will be flaunting global trends as climate displacement increases, exacerbating global strain on resources.
|
||||
|
||||
**Social Transformations:**
|
||||
|
||||
1. **Rise of Social Movements and Activism**: The next decade will witness a strong rise in social activism and movements focused on various causes, including climate change, social injustice, and human rights.
|
||||
2. **Space Exploration and Colonization**: Following advances in private space entrepreneurship and the renewal of public investment in space exploration, human presence off Earth is going to foreman annually.
|
||||
3. **Intensification of Mental and Physical Health Issues**: Rising stress and pressure on physical and mental well-being from societal, technological and environmental factors, the next decade may bring instances that are foreseeably worse.
|
||||
55
packages/osr-code-bot/docs/meta/ny.md
Normal file
@ -0,0 +1,55 @@
|
||||
---
|
||||
title: "Open Source and FabLabs in New York"
|
||||
date: "2024-02-16"
|
||||
draft: false
|
||||
---
|
||||
|
||||
# Open Source and FabLabs in New York
|
||||
|
||||
New York City is a vibrant hub for makers, hackers, and open source enthusiasts. Here's a curated list of spaces and resources in the city.
|
||||
|
||||
## FabLabs and Makerspaces
|
||||
|
||||
1. [[NYC Resistor](https://www.nycresistor.com)]
|
||||
- A community-driven hackerspace and makerspace
|
||||
- Focus on electronics, 3D printing, and open source projects
|
||||
|
||||
2. [[GenSpace](https://www.genspace.org)]
|
||||
- A hackerspace and makerspace in Brooklyn
|
||||
- Offers workshops and events
|
||||
|
||||
3. **MakerBot**
|
||||
- A community makerspace focused on robotics and AI
|
||||
- Runs educational programs and workshops
|
||||
|
||||
## Open Source Communities
|
||||
|
||||
1. **NYC Open Source**
|
||||
- A community group for open source developers
|
||||
- Regular meetups and hackathons
|
||||
|
||||
2. [[HackNY](https://hackny.org)]
|
||||
- Organizes hackathons and tech events
|
||||
- Focus on open data and civic technology
|
||||
|
||||
## Resources and Events
|
||||
|
||||
- **NYC Maker Faire**: Annual event celebrating maker culture
|
||||
- **Open Source NYC**: Regular meetups and conferences
|
||||
- **Hacker Hours**: Weekly meetups for coding and hacking
|
||||
|
||||
## Learning Opportunities
|
||||
|
||||
Many of these spaces offer:
|
||||
- Workshops and classes
|
||||
- Mentoring programs
|
||||
- Access to tools and equipment
|
||||
- Networking opportunities
|
||||
|
||||
## Get Involved
|
||||
|
||||
To get involved in the NYC maker and open source scene:
|
||||
1. Join local meetup groups
|
||||
2. Visit hackerspaces and makerspaces
|
||||
3. Participate in hackathons and events
|
||||
4. Contribute to local open source projects
|
||||
138
packages/osr-code-bot/docs/meta/the-future.md
Normal file
@ -0,0 +1,138 @@
|
||||
When looking at the next decade (or beyond), **capitalism, greed, and fascism** (or any authoritarian movement) are all deeply interwoven with broader social, political, and economic currents. Predicting exactly how they’ll evolve is complex, but here are some general considerations and possible trajectories:
|
||||
|
||||
---
|
||||
|
||||
## 1. Capitalism Under Strain
|
||||
|
||||
1. **Rising Inequality**
|
||||
- As technology advances (automation, AI), wealth often concentrates in the hands of those who control capital, patents, and data.
|
||||
- If this concentration continues unchecked, it can fuel resentment, social unrest, or populist backlash.
|
||||
|
||||
2. **Climate Crisis Pressures**
|
||||
- The costs of mitigating and adapting to climate change could stress the traditional capitalist model. Governments may be forced to intervene more aggressively in markets (e.g., carbon taxes, green subsidies, stricter regulations).
|
||||
- Corporations may adapt by presenting themselves as “green” or “sustainable,” but critics argue this can be superficial if profit remains the primary driver.
|
||||
|
||||
3. **Possible Reforms or Transitions**
|
||||
- Some regions might shift toward more regulated or “stakeholder” forms of capitalism, where social and environmental considerations become part of the bottom line.
|
||||
- Experiments with universal basic income, wealth taxes, or new social safety nets might emerge in response to automation and inequality.
|
||||
|
||||
---
|
||||
|
||||
## 2. Greed & Concentration of Power
|
||||
|
||||
1. **Corporate Power**
|
||||
- If huge multinational firms continue to outgrow or outmaneuver government regulations, we could see more “corporate states” wielding influence across borders.
|
||||
- Monopolistic or oligopolistic markets may lock in consumers, limiting competition and innovation.
|
||||
|
||||
2. **Tech Billionaires & Influence**
|
||||
- Individual tech magnates can exert enormous influence over policy, media, and public discourse (think of social media platforms, private space ventures, etc.).
|
||||
- Public backlash against perceived “tech oligarchs” might spark new regulatory pushes or social movements demanding accountability.
|
||||
|
||||
---
|
||||
|
||||
## 3. Authoritarian & Fascist Currents
|
||||
|
||||
1. **Populist Nationalism**
|
||||
- Economic frustration—especially if tied to unemployment, rising living costs, or cultural change—can fuel populist, nationalistic, and xenophobic rhetoric.
|
||||
- In some places, leaders may capitalize on economic and social fears to consolidate power and undermine democratic institutions.
|
||||
|
||||
2. **Erosion of Democratic Norms**
|
||||
- We’ve already seen leaders in various countries challenge press freedom, weaken checks and balances, or use technology for mass surveillance.
|
||||
- If political polarization continues, more segments of the population could become disillusioned with democratic governance, allowing authoritarian or fascist ideologies to gain ground.
|
||||
|
||||
3. **Role of Technology in Control**
|
||||
- Advanced AI-driven surveillance systems can give authoritarian regimes powerful tools to monitor and suppress dissent.
|
||||
- Disinformation campaigns can polarize societies further, making it easier for extremist ideologies to take hold.
|
||||
|
||||
---
|
||||
|
||||
## 4. Countervailing Forces & Possible Outcomes
|
||||
|
||||
1. **Grassroots Movements & Civil Society**
|
||||
- Social movements—environmental activists, labor organizers, pro-democracy groups—may push back against corporate greed or authoritarian policies.
|
||||
- Digital technology can also empower activists (e.g., decentralized organizing, crowdfunding, alternative media).
|
||||
|
||||
2. **Global Cooperation vs. Fragmentation**
|
||||
- Global crises (climate change, pandemics, refugee flows) demand collective problem-solving. Successful collaboration could strengthen international institutions and moderate extremism.
|
||||
- If cooperation fails or public trust in institutions erodes, we may see more isolationism and the rise of extremist factions.
|
||||
|
||||
3. **Economic “Resets” or Shocks**
|
||||
- Significant economic downturns (like a major recession or financial crisis) could reshape political landscapes. Hardship often fuels both leftist calls for redistribution and right-wing nationalist/fascist sentiments.
|
||||
- Conversely, robust economic recoveries or new industries (e.g., green tech, biotech) could reduce desperation and undercut extremist appeals—if the benefits are widely shared.
|
||||
|
||||
---
|
||||
|
||||
## 5. Putting It All Together
|
||||
|
||||
- **Capitalism** is adaptable and has historically reinvented itself in response to crises (e.g., welfare states post-WWII, the neoliberal shift in the 1980s). Over the next decade, multiple stressors—inequality, climate challenges, tech disruptions—may force further adaptation or reforms.
|
||||
- **Greed** will likely persist; it’s woven into many current economic systems. However, intensifying calls for accountability (both from governments and the public) might curb the worst excesses—or at least try to.
|
||||
- **Fascism and other authoritarian trends** can thrive when people feel economically insecure, distrustful of institutions, or marginalized. Whether such movements gain or lose ground will depend partly on whether democracies can effectively address inequality, climate crises, and cultural polarization.
|
||||
|
||||
In short, the next decade could see a tug-of-war between **entrenched interests/greed** and **grassroots/structural reforms**, with **authoritarianism** or **fascism** emerging where economic and social tensions go unresolved. But there are also real avenues for positive change—if political will and public engagement push toward more equitable, inclusive, and sustainable systems.
|
||||
|
||||
Ultimately, it’s not a simple trajectory: these forces will play out differently by region and context. Human agency, collective action, and political choices will determine which path(s) become reality.
|
||||
|
||||
|
||||
## Social media
|
||||
Forecasting the trajectory of social media platforms over the next decade involves examining multiple trends—technological, economic, regulatory, and cultural. While the specific outcomes will vary by region and platform, here are some notable directions and shifts we’re likely to see:
|
||||
|
||||
---
|
||||
|
||||
## 1. Increasing Regulation & Governance
|
||||
- **Government intervention**: Expect more stringent policies around content moderation, user privacy, data handling, and platform accountability—especially in the U.S., EU, and other major economies.
|
||||
- **Platform liability**: Debates about where to draw the line between free speech and harmful content will continue, with platforms facing pressure to remove extremist or misleading content.
|
||||
- **Antitrust and breakup talks**: Large social media conglomerates (Meta, for instance) may face antitrust scrutiny and be pressured to divest some services or open up their APIs.
|
||||
|
||||
---
|
||||
|
||||
## 2. Evolving Monetization Models
|
||||
- **Subscription tiers**: Platforms will experiment with “premium” or ad-free tiers to offset reliance on advertising revenue.
|
||||
- **Creator economy**: Tools for creators (patronage programs, subscription-based communities, NFT-like digital goods) will expand, letting influencers and content producers monetize directly from fans.
|
||||
- **Social commerce**: Integration of e-commerce features (live-stream shopping, in-app checkouts) will become more seamless, making social platforms a core shopping destination.
|
||||
|
||||
---
|
||||
|
||||
## 3. Fragmentation & Niche Communities
|
||||
- **Platform fatigue**: Over-saturation of large networks and privacy concerns may push users to smaller, niche or invite-only platforms (e.g., specialized Discord servers, Mastodon instances, community-driven apps).
|
||||
- **Identity-based networks**: Groups around shared interests, lifestyles, or professional goals will gain traction, offering curated experiences instead of “everyone on one big feed.”
|
||||
- **Decentralized models**: Open protocols (ActivityPub, Matrix, etc.) may drive “federated” social media ecosystems, where users control their own data and moderate local communities.
|
||||
|
||||
---
|
||||
|
||||
## 4. AI-Driven Personalization & Moderation
|
||||
- **Algorithmic curation**: Personalization will become more pervasive, with advanced AI suggesting content tailored to users’ behaviors, interests, and social circles—sometimes leading to echo-chamber concerns.
|
||||
- **Automated moderation**: Platforms will lean heavily on AI to detect hateful content, misinformation, or abuse. However, false positives and biased datasets can lead to user pushback or calls for transparency.
|
||||
- **Synthetic media & deepfakes**: Detecting AI-generated content will become a central challenge. Platforms may roll out watermarking or verification features for authentic content.
|
||||
|
||||
---
|
||||
|
||||
## 5. Privacy & Data Ownership
|
||||
- **End-to-end encryption**: Some platforms (or messaging services within them) will emphasize encryption and user data protection, balancing security needs with law-enforcement pressures.
|
||||
- **User-control movement**: Rising awareness around data privacy may prompt more “data portability” tools, enabling users to export or self-host their information.
|
||||
- **Zero-party data**: Platforms and advertisers might shift to collecting data that users explicitly volunteer, rather than passive tracking or third-party cookies.
|
||||
|
||||
---
|
||||
|
||||
## 6. VR/AR & the “Metaverse” Vision
|
||||
- **Immersive social experiences**: If VR/AR headsets become cheaper and more comfortable, some platforms will push “metaverse” ecosystems for social interaction, gaming, events, and commerce.
|
||||
- **Hybrid experiences**: For most users, immersive worlds might remain occasional or niche. Expect a blend of traditional feeds with occasional XR “hangouts” or events.
|
||||
- **Challenges to adoption**: High hardware costs and interface complexity could slow mainstream adoption, while privacy issues in a 3D environment add new regulatory questions.
|
||||
|
||||
---
|
||||
|
||||
## 7. Globalization vs. Regional Splintering
|
||||
- **Localized platforms**: In places where governments restrict foreign platforms (e.g., China, or emerging regulatory regimes elsewhere), local competitors will flourish.
|
||||
- **Cultural divergence**: As content rules and moderation standards differ by region, platforms may increasingly segment services or features to comply with local laws.
|
||||
- **Cross-border influences**: Despite splintering, “global” trends (music, memes, political movements) will still spread, but possibly through a patchwork of regional networks.
|
||||
|
||||
---
|
||||
|
||||
### Putting It All Together
|
||||
Over the next decade, social media will likely:
|
||||
- Become more **regulated**, with heightened scrutiny around privacy, content moderation, and monopolistic practices.
|
||||
- Pursue **diversified monetization** strategies (subscriptions, creator tools, social commerce).
|
||||
- Continue to **fragment**, as users seek more targeted or decentralized communities.
|
||||
- Lean on **advanced AI** for personalization and moderation—while grappling with new challenges like deepfakes.
|
||||
- Explore **immersive experiences** (VR/AR) but face barriers to widespread adoption.
|
||||
|
||||
Ultimately, social media’s direction will hinge on how well platforms balance user autonomy, safety, and profit motives—and how governments and the public respond to evolving digital ecosystems. The “one big social network for everyone” model may fade, replaced by a more complex, multi-layered landscape of communities and niche experiences.
|
||||
77
packages/osr-code-bot/docs/meta/women.md
Normal file
@ -0,0 +1,77 @@
|
||||
---
|
||||
title: "Women's Equality Across Continents"
|
||||
date: 2023-12-21
|
||||
draft: false
|
||||
tags: ["women's rights", "gender equality", "global perspective"]
|
||||
---
|
||||
|
||||
# Women's Equality: A Global Perspective
|
||||
|
||||
Women's equality remains a critical global issue, with significant variations across different continents. According to the [Global Gender Gap Report 2023](https://www.weforum.org/publications/global-gender-gap-report-2023/), the global gender gap has been closed by 68.4% as of 2023. Let's explore the current state of women's equality in each major continent.
|
||||
|
||||
## Europe
|
||||
|
||||
Europe has made significant strides in gender equality, with:
|
||||
|
||||
- Strong legislative frameworks for gender equality
|
||||
- High female labor force participation (76.6% in Nordic countries)
|
||||
- Progressive parental leave policies, with up to 48 weeks in some countries
|
||||
- Significant female representation in politics (40% average in the EU parliament)
|
||||
- An average gender pay gap of 12.7% across the EU
|
||||
- Some countries like Luxembourg and Romania have gaps below 5%
|
||||
|
||||
## North America
|
||||
|
||||
North America shows mixed progress:
|
||||
|
||||
- High educational attainment for women (58% of U.S. college graduates are women)
|
||||
- Ongoing discussions about wage gaps (women earn 83 cents for every dollar earned by men in the U.S.)
|
||||
- Increasing corporate leadership roles for women (8.8% of Fortune 500 CEOs)
|
||||
- In Canada, the gender wage gap is 89 cents to the dollar
|
||||
- Challenges in paid family leave policies
|
||||
|
||||
## Asia
|
||||
|
||||
The world's largest continent shows diverse patterns:
|
||||
|
||||
- Rapid progress in East Asian economies, with Japan reaching 72% gender parity
|
||||
- Significant challenges in South Asia, with a 62.3% average gender parity
|
||||
- In Japan, women earn 23.7% less than men on average
|
||||
- In South Korea, the pay gap is one of the highest at 31.5%
|
||||
- Increasing educational opportunities
|
||||
- Cultural barriers in some regions
|
||||
|
||||
## Africa
|
||||
|
||||
The African continent shows both progress and persistent challenges:
|
||||
|
||||
- Increasing female political representation (Rwanda leads globally with 61.3% women in parliament)
|
||||
- Growing entrepreneurship among women (26% of female adults engaged in entrepreneurship)
|
||||
- Wage gaps vary widely, with women earning 20-50% less than men in many countries
|
||||
- Continued challenges in educational access (33% of girls in Sub-Saharan Africa do not attend school)
|
||||
- Traditional practices affecting gender equality
|
||||
|
||||
## South America
|
||||
|
||||
South America demonstrates evolving dynamics:
|
||||
|
||||
- Strong female participation in higher education (57% of university students)
|
||||
- Growing women's movements (Ni Una Menos movement)
|
||||
- Significant pay disparities (women earn 25% less than men on average)
|
||||
- In Brazil, the gender pay gap is 29.7%
|
||||
- Progressive policies in some countries
|
||||
|
||||
## Oceania
|
||||
|
||||
Oceania presents a unique context:
|
||||
|
||||
- Strong legislative protections
|
||||
- High female workforce participation (72% in Australia)
|
||||
- Australian women earn on average 13.8% less than men
|
||||
- New Zealand has a smaller gender pay gap of 9.1%
|
||||
- Challenges in remote and indigenous communities
|
||||
- Progressive policies in Australia and New Zealand, with both countries in the global top 10 for gender parity
|
||||
|
||||
## Conclusion
|
||||
|
||||
While progress toward women's equality varies significantly across continents, global trends show gradual improvement. At the current rate of progress, it will take 131 years to reach full gender parity globally. Continued efforts in policy-making, education, and cultural change are essential for achieving genuine gender equality worldwide.
|
||||
7512
packages/osr-code-bot/docs/package-lock.json
generated
Normal file
18
packages/osr-code-bot/docs/package.json
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
"name": "starlight",
|
||||
"type": "module",
|
||||
"version": "0.0.1",
|
||||
"scripts": {
|
||||
"dev": "astro dev",
|
||||
"start": "astro dev",
|
||||
"build": "astro build",
|
||||
"preview": "astro preview",
|
||||
"astro": "astro"
|
||||
},
|
||||
"dependencies": {
|
||||
"@astrojs/starlight": "^0.30.5",
|
||||
"astro": "^5.0.2",
|
||||
"astro-code-editor": "^0.1.1",
|
||||
"sharp": "^0.32.5"
|
||||
}
|
||||
}
|
||||
1
packages/osr-code-bot/docs/public/favicon.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128"><path fill-rule="evenodd" d="M81 36 64 0 47 36l-1 2-9-10a6 6 0 0 0-9 9l10 10h-2L0 64l36 17h2L28 91a6 6 0 1 0 9 9l9-10 1 2 17 36 17-36v-2l9 10a6 6 0 1 0 9-9l-9-9 2-1 36-17-36-17-2-1 9-9a6 6 0 1 0-9-9l-9 10v-2Zm-17 2-2 5c-4 8-11 15-19 19l-5 2 5 2c8 4 15 11 19 19l2 5 2-5c4-8 11-15 19-19l5-2-5-2c-8-4-15-11-19-19l-2-5Z" clip-rule="evenodd"/><path d="M118 19a6 6 0 0 0-9-9l-3 3a6 6 0 1 0 9 9l3-3Zm-96 4c-2 2-6 2-9 0l-3-3a6 6 0 1 1 9-9l3 3c3 2 3 6 0 9Zm0 82c-2-2-6-2-9 0l-3 3a6 6 0 1 0 9 9l3-3c3-2 3-6 0-9Zm96 4a6 6 0 0 1-9 9l-3-3a6 6 0 1 1 9-9l3 3Z"/><style>path{fill:#000}@media (prefers-color-scheme:dark){path{fill:#fff}}</style></svg>
|
||||
|
After Width: | Height: | Size: 696 B |
BIN
packages/osr-code-bot/docs/src/assets/houston.webp
Normal file
|
After Width: | Height: | Size: 96 KiB |
7
packages/osr-code-bot/docs/src/content.config.ts
Normal file
@ -0,0 +1,7 @@
|
||||
import { defineCollection } from 'astro:content';
|
||||
import { docsLoader } from '@astrojs/starlight/loaders';
|
||||
import { docsSchema } from '@astrojs/starlight/schema';
|
||||
|
||||
export const collections = {
|
||||
docs: defineCollection({ loader: docsLoader(), schema: docsSchema() }),
|
||||
};
|
||||
@ -0,0 +1,11 @@
|
||||
---
|
||||
title: Example Guide
|
||||
description: A guide in my new Starlight docs site.
|
||||
---
|
||||
|
||||
Guides lead a user through a specific task they want to accomplish, often with a sequence of steps.
|
||||
Writing a good guide requires thinking about what your users are trying to do.
|
||||
|
||||
## Further reading
|
||||
|
||||
- Read [about how-to guides](https://diataxis.fr/how-to-guides/) in the Diátaxis framework
|
||||
39
packages/osr-code-bot/docs/src/content/docs/index.mdx
Normal file
@ -0,0 +1,39 @@
|
||||
---
|
||||
title: Welcome to Starlight
|
||||
description: Get started building your docs site with Starlight.
|
||||
template: splash
|
||||
hero:
|
||||
tagline: Congrats on setting up a new Starlight project!
|
||||
image:
|
||||
file: ../../assets/houston.webp
|
||||
actions:
|
||||
- text: Documentation
|
||||
link: /meta/files
|
||||
icon: right-arrow
|
||||
- text: Lydia
|
||||
link: /meta/lydia
|
||||
icon: right-arrow
|
||||
- text: Read the Starlight docs
|
||||
link: https://starlight.astro.build
|
||||
icon: external
|
||||
variant: minimal
|
||||
---
|
||||
|
||||
import { Card, CardGrid } from '@astrojs/starlight/components';
|
||||
|
||||
## Next steps
|
||||
|
||||
<CardGrid stagger>
|
||||
<Card title="Update content" icon="pencil">
|
||||
Edit `src/content/docs/index.mdx` to see this page change.
|
||||
</Card>
|
||||
<Card title="Add new content" icon="add-document">
|
||||
Add Markdown or MDX files to `src/content/docs` to create new pages.
|
||||
</Card>
|
||||
<Card title="Configure your site" icon="setting">
|
||||
Edit your `sidebar` and other config in `astro.config.mjs`.
|
||||
</Card>
|
||||
<Card title="Read the docs" icon="open-book">
|
||||
Learn more in [the Starlight Docs](https://starlight.astro.build/).
|
||||
</Card>
|
||||
</CardGrid>
|
||||
95
packages/osr-code-bot/docs/src/content/docs/meta/files.md
Normal file
@ -0,0 +1,95 @@
|
||||
---
|
||||
title: "The Future of Files and Content: A 10-Year Outlook"
|
||||
date: 2024-01-29
|
||||
draft: false
|
||||
tags: ["future", "content", "files", "annotations"]
|
||||
---
|
||||
|
||||
## The Evolving Nature of Files and Content
|
||||
|
||||
As we look toward the next decade, the concept of "files" as we know them is poised for a dramatic transformation. The traditional notion of discrete, self-contained units of data is evolving into something far more fluid, contextual, and interconnected. This evolution is driven by advancements in technology, changing user expectations, and the increasing complexity of information ecosystems.
|
||||
|
||||
Files have historically been defined by their boundaries—specific containers of data isolated by format, location, and context. However, as technology progresses, this rigid structure is being dismantled in favor of more dynamic and flexible data models. Future files will encapsulate content that seamlessly integrates across applications, platforms, and devices, allowing for a more cohesive digital experience.
|
||||
|
||||
The shift is not just technical but conceptual, as it reflects a broader understanding of information management. In practice, this means transcending the limitations of traditional file systems to embrace structures that prioritize user context, behavioral insights, and multidimensional data relationships.
|
||||
|
||||
## The Decline of Traditional File Systems
|
||||
|
||||
In the coming years, we'll likely see a gradual shift away from traditional hierarchical file systems. The rigid tree-like structures of directories and folders will give way to more advanced systems optimized for accessibility and adaptability, emphasizing content's intrinsic value over its mere location. Here are key elements of this transformation:
|
||||
|
||||
- **Content-Centric Storage**: Future storage architectures will prioritize the meaning and context of information. By classifying data based on its inherent properties and usage patterns rather than its physical location, users can retrieve and interact with content based on relevance. This approach leverages metadata, semantic analysis, and user habits to create intuitive and personalized storage environments.
|
||||
|
||||
- **Fluid Documents**: The concept of documents is expanding to encompass living, evolving entities that can exist in multiple states and versions simultaneously. These documents will not be tied to a single format or static representation but will adapt fluidly to the context in which they are accessed, offering users the most pertinent and updated view at any moment.
|
||||
|
||||
- **Dynamic Composition**: With dynamic composition, content can assemble itself from various sources in real-time, tailored to specific user needs or contextual triggers. This capability transforms the static consumption of information into a continuously adaptable and interactive experience, ensuring that users receive the most relevant and complete narrative.
|
||||
|
||||
## The Rise of Intelligent Annotations
|
||||
|
||||
One of the most significant developments in the next decade will be the evolution of annotations. No longer confined to the margins or attached in static form, annotations will become integral to digital content, offering layers of intelligence, interactivity, and customization.
|
||||
|
||||
### 1. Contextually Aware
|
||||
|
||||
Annotations will transcend simple text notes, evolving into systems that understand and interact with their environment. They will:
|
||||
|
||||
- Analyze relationships not only with the underlying content but also with other annotations and external data sources. This interconnectedness will enable richer narratives and insights derived from a web of contextually relevant information.
|
||||
- Integrate with user behavior and preferences to provide personalized experiences. By learning from user interactions and historical data, annotations will adapt their presentation and functionality to align with individual needs and expectations, enhancing user engagement.
|
||||
|
||||
### 2. Interactive and Dynamic
|
||||
|
||||
The transformation of annotations will see them evolve from static marks to complex, interactive ecosystems. Future annotations will:
|
||||
|
||||
- Act as interactive layers that provide deeper insights or auxiliary content upon engagement. They transform a document into an exploratory landscape, whereby users can uncover supplementary data or functionality as needed.
|
||||
- Update dynamically to reflect new information, ensuring that annotations and the content they enhance remain current and accurate. AI-driven mechanisms can automatically incorporate updates or revisions pertinent to the annotation context.
|
||||
|
||||
- Spur collaboration by serving as arenas for discussion and idea exchange. Annotations will support real-time collaboration, allowing multiple users to contribute, comment, and modify information within a shared digital space.
|
||||
|
||||
### 3. Semantically Rich Metadata
|
||||
|
||||
Annotations, enriched with semantics, will become pivotal to understanding content in depth. They will:
|
||||
|
||||
- Encode structured data that artificial intelligence systems can process, enabling advanced analysis and inference. This will enhance machine understanding of content contexts and relationships, facilitating more effective automation and decision-making processes.
|
||||
- Establish links to related concepts and resources, building rich networks of content that offer diverse perspectives and supplemental information.
|
||||
|
||||
- Include comprehensive version history and provenance details to ensure transparency and accountability. Users will be able to trace the evolution of annotations and their impacts on the primary content.
|
||||
|
||||
- Carry contextual metadata that describes usage patterns, relevancy, and interaction history, enabling future systems to fine-tune experiences based on aggregated insights.
|
||||
|
||||
## The Future of Collaboration
|
||||
|
||||
Content creation and consumption will become increasingly collaborative, moving beyond isolated experiences to foster community-driven innovation and productivity.
|
||||
|
||||
- **Real-Time Co-Editing**: Future collaborative processes will benefit from seamless and simultaneous multi-user editing capabilities. This real-time interaction will reduce barriers to teamwork and increase efficiency, allowing contributors to see and respond to changes instantly.
|
||||
|
||||
- **Contextual Awareness**: As collaborators work on shared content, systems will provide awareness of others' modifications without overwhelming users. This will create a synchronized understanding across teams and minimize conflicts by highlighting relevant changes and comments in context.
|
||||
|
||||
- **Automated Synchronization**: Professional and personal workflows will increasingly rely on automated, cross-platform synchronization. Data will migrate fluidly across devices—ensuring that users have access to the latest versions of content regardless of their active device or location.
|
||||
|
||||
- **Intelligent Conflict Resolution**: AI will mediate collaborative spaces, providing smart solutions to resolve conflicts that arise from simultaneous content modifications. These systems will offer conflict suggestions or merge decisions, simplifying user interaction and maintaining content integrity.
|
||||
|
||||
## The Role of AI in Content Management
|
||||
|
||||
Artificial Intelligence will be pivotal in revolutionizing content management systems, offering capabilities that enhance organizational efficiency, user experience, and adaptability.
|
||||
|
||||
1. **Content Organization**
|
||||
- AI systems will autonomously categorize content by analyzing its semantic properties, usage patterns, and potential relationships, streamlining how information is stored and retrieved.
|
||||
- Intelligent tagging will replace manual labelings, such that content is associated with context-aware tags automatically assigned by understanding content semantics and usage context.
|
||||
- Contextual search mechanisms will leverage AI to anticipate user intentions and present the most relevant results quickly, charitably synthesizing user needs and search history.
|
||||
|
||||
2. **Content Generation**
|
||||
- Automated summarization tools will enable users to distill vast amounts of information into concise, insightful overviews, facilitating faster understanding and decision-making.
|
||||
- Systems will analyze content contexts to offer suggestions or enhancements tailored to user objectives and situational demands.
|
||||
- Dynamic content adaptation will adjust narratives or presentations based on real-time factors such as audience, platform, and device preferences.
|
||||
|
||||
## Privacy and Security Considerations
|
||||
|
||||
As content becomes more interconnected, new challenges will emerge that necessitate innovative solutions to safeguard user privacy and content integrity.
|
||||
|
||||
- **Granular Access Control**: Future systems will need robust access management tools to define user permissions at more granular levels, ensuring that different content aspects are accessible according to precise security roles and protocols.
|
||||
|
||||
- **Encrypted Annotations**: Annotations will incorporate cryptographic measures to secure data while allowing authorized collaboration. This encryption ensures privacy while maintaining the flexibility of sharing and editing within trusted communities.
|
||||
|
||||
- **Blockchain-Based Verification**: Content authenticity and integrity will be enhanced through blockchain technology, offering decentralized and tamper-proof means to verify information provenance and historical modifications, increasing trust in digital content.
|
||||
|
||||
## Conclusion
|
||||
|
||||
The next decade will see a fundamental rethinking of how we create, store, and interact with content. The future of files lies not in their traditional, static form, but in a more dynamic, interconnected, and intelligent ecosystem of information. This vision is underpinned by the transformative role of intelligent annotations, AI-driven content management, and evolving paradigms that prioritize meaning, context, and collaboration. By embracing these changes, we can unlock deeper insights, nurture innovation, and foster richer digital experiences that keep pace with an ever-changing world.
|
||||
319
packages/osr-code-bot/docs/src/content/docs/meta/lydia.md
Normal file
@ -0,0 +1,319 @@
|
||||
---
|
||||
keywords:
|
||||
- ""
|
||||
rGallery:
|
||||
- name: col
|
||||
url: "https://assets.osr-plastic.org/extrusion/lydia-v3.5/media/gallery/col.jpg"
|
||||
thumb: "https://assets.osr-plastic.org/extrusion/lydia-v3.5/media/gallery//col-thu\
|
||||
mb.webp"
|
||||
responsive: "https://assets.osr-plastic.org/extrusion/lydia-v3.5/media/gallery//we\
|
||||
bp/col.webp"
|
||||
meta: {}
|
||||
keywords:
|
||||
- ""
|
||||
description: " "
|
||||
alt: " - "
|
||||
width: 1980
|
||||
height: 1115
|
||||
title: ""
|
||||
- name: DSC02943
|
||||
url: "https://assets.osr-plastic.org/extrusion/lydia-v3.5/media/gallery/DSC02943.J\
|
||||
PG"
|
||||
thumb: "https://assets.osr-plastic.org/extrusion/lydia-v3.5/media/gallery//DSC0294\
|
||||
3-thumb.webp"
|
||||
responsive: "https://assets.osr-plastic.org/extrusion/lydia-v3.5/media/gallery//we\
|
||||
bp/DSC02943.webp"
|
||||
meta: {}
|
||||
keywords:
|
||||
- ""
|
||||
description: " "
|
||||
alt: " - "
|
||||
width: 1980
|
||||
height: 1320
|
||||
title: ""
|
||||
- name: DSC02949
|
||||
url: "https://assets.osr-plastic.org/extrusion/lydia-v3.5/media/gallery/DSC02949.J\
|
||||
PG"
|
||||
thumb: "https://assets.osr-plastic.org/extrusion/lydia-v3.5/media/gallery//DSC0294\
|
||||
9-thumb.webp"
|
||||
responsive: "https://assets.osr-plastic.org/extrusion/lydia-v3.5/media/gallery//we\
|
||||
bp/DSC02949.webp"
|
||||
meta: {}
|
||||
keywords:
|
||||
- ""
|
||||
description: " "
|
||||
alt: " - "
|
||||
width: 1980
|
||||
height: 1320
|
||||
title: ""
|
||||
- name: IMG_20231106_153433
|
||||
url: "https://assets.osr-plastic.org/extrusion/lydia-v3.5/media/gallery/IMG_202311\
|
||||
06_153433.jpg"
|
||||
thumb: "https://assets.osr-plastic.org/extrusion/lydia-v3.5/media/gallery//IMG_202\
|
||||
31106_153433-thumb.webp"
|
||||
responsive: "https://assets.osr-plastic.org/extrusion/lydia-v3.5/media/gallery//we\
|
||||
bp/IMG_20231106_153433.webp"
|
||||
meta: {}
|
||||
keywords:
|
||||
- ""
|
||||
description: ""
|
||||
alt: " - "
|
||||
width: 1980
|
||||
height: 2640
|
||||
title: ""
|
||||
- name: IMG_20231106_154012
|
||||
url: "https://assets.osr-plastic.org/extrusion/lydia-v3.5/media/gallery/IMG_202311\
|
||||
06_154012.jpg"
|
||||
thumb: "https://assets.osr-plastic.org/extrusion/lydia-v3.5/media/gallery//IMG_202\
|
||||
31106_154012-thumb.webp"
|
||||
responsive: "https://assets.osr-plastic.org/extrusion/lydia-v3.5/media/gallery//we\
|
||||
bp/IMG_20231106_154012.webp"
|
||||
meta: {}
|
||||
keywords:
|
||||
- ""
|
||||
description: ""
|
||||
alt: " - "
|
||||
width: 1980
|
||||
height: 2640
|
||||
title: ""
|
||||
- name: latest
|
||||
url: "https://assets.osr-plastic.org/extrusion/lydia-v3.5/media/gallery/latest.jpg"
|
||||
thumb: "https://assets.osr-plastic.org/extrusion/lydia-v3.5/media/gallery//latest-\
|
||||
thumb.webp"
|
||||
responsive: "https://assets.osr-plastic.org/extrusion/lydia-v3.5/media/gallery//we\
|
||||
bp/latest.webp"
|
||||
meta: {}
|
||||
keywords:
|
||||
- ""
|
||||
description: ""
|
||||
alt: " - "
|
||||
width: 2230
|
||||
height: 2216
|
||||
title: ""
|
||||
- name: latest_pers
|
||||
url: "https://assets.osr-plastic.org/extrusion/lydia-v3.5/media/gallery/latest_per\
|
||||
s.jpg"
|
||||
thumb: "https://assets.osr-plastic.org/extrusion/lydia-v3.5/media/gallery//latest_\
|
||||
pers-thumb.webp"
|
||||
responsive: "https://assets.osr-plastic.org/extrusion/lydia-v3.5/media/gallery//we\
|
||||
bp/latest_pers.webp"
|
||||
meta: {}
|
||||
keywords:
|
||||
- ""
|
||||
description: ""
|
||||
alt: " - "
|
||||
width: 2896
|
||||
height: 2121
|
||||
title: ""
|
||||
- name: latest_white
|
||||
url: "https://assets.osr-plastic.org/extrusion/lydia-v3.5/media/gallery/latest_whi\
|
||||
te.png"
|
||||
thumb: "https://assets.osr-plastic.org/extrusion/lydia-v3.5/media/gallery//latest_\
|
||||
white-thumb.webp"
|
||||
responsive: "https://assets.osr-plastic.org/extrusion/lydia-v3.5/media/gallery//we\
|
||||
bp/latest_white.webp"
|
||||
meta: {}
|
||||
keywords:
|
||||
- ""
|
||||
description: ""
|
||||
alt: " - "
|
||||
width: 501
|
||||
height: 498
|
||||
title: ""
|
||||
- name: pers
|
||||
url: "https://assets.osr-plastic.org/extrusion/lydia-v3.5/media/gallery/pers.jpg"
|
||||
thumb: "https://assets.osr-plastic.org/extrusion/lydia-v3.5/media/gallery//pers-th\
|
||||
umb.webp"
|
||||
responsive: "https://assets.osr-plastic.org/extrusion/lydia-v3.5/media/gallery//we\
|
||||
bp/pers.webp"
|
||||
meta: {}
|
||||
keywords:
|
||||
- ""
|
||||
description: ""
|
||||
alt: " - "
|
||||
width: 1980
|
||||
height: 1980
|
||||
title: ""
|
||||
rGalleryRenderings:
|
||||
- name: brief
|
||||
url: "https://assets.osr-plastic.org/extrusion/lydia-v3.5/renderings/brief.jpg"
|
||||
thumb: "https://assets.osr-plastic.org/extrusion/lydia-v3.5/renderings//brief-thum\
|
||||
b.webp"
|
||||
responsive: "https://assets.osr-plastic.org/extrusion/lydia-v3.5/renderings//webp/\
|
||||
brief.webp"
|
||||
meta: {}
|
||||
keywords:
|
||||
- ""
|
||||
description: ""
|
||||
alt: " - "
|
||||
width: 2329
|
||||
height: 3345
|
||||
title: ""
|
||||
- name: components
|
||||
url: "https://assets.osr-plastic.org/extrusion/lydia-v3.5/renderings/components.jp\
|
||||
g"
|
||||
thumb: "https://assets.osr-plastic.org/extrusion/lydia-v3.5/renderings//components\
|
||||
-thumb.webp"
|
||||
responsive: "https://assets.osr-plastic.org/extrusion/lydia-v3.5/renderings//webp/\
|
||||
components.webp"
|
||||
meta: {}
|
||||
keywords:
|
||||
- ""
|
||||
description: ""
|
||||
alt: " - "
|
||||
width: 1988
|
||||
height: 1536
|
||||
title: ""
|
||||
- name: perspective
|
||||
url: "https://assets.osr-plastic.org/extrusion/lydia-v3.5/renderings/perspective.j\
|
||||
pg"
|
||||
thumb: "https://assets.osr-plastic.org/extrusion/lydia-v3.5/renderings//perspectiv\
|
||||
e-thumb.webp"
|
||||
responsive: "https://assets.osr-plastic.org/extrusion/lydia-v3.5/renderings//webp/\
|
||||
perspective.webp"
|
||||
meta: {}
|
||||
keywords:
|
||||
- ""
|
||||
description: ""
|
||||
alt: " - "
|
||||
width: 1980
|
||||
height: 1584
|
||||
title: ""
|
||||
title: "Extrusion v3.6 - Lydia"
|
||||
author: PlasticHub
|
||||
description: ""
|
||||
category: Plastic_Extrusion_Machines
|
||||
client: Universities and R&D services
|
||||
prices: 1800 - 12002 Euro
|
||||
built: "2023"
|
||||
thumb: "https://assets.osr-plastic.org/extrusion/lydia-v3.5/media/latest-thumb.webp"
|
||||
---
|
||||
|
||||
<div class="container my-4">
|
||||
<div class="row">
|
||||
<div class="col-md-6"><div style="width:100%; height:500px;margin:auto">{{%rGallery%}}</div></div>
|
||||
<div class="col-md-6">
|
||||
<h1 style="text-align: left;">Extrusion v3.6 - Lydia</h1>
|
||||
<p class="fs-3"></p>
|
||||
<ul class="list-unstyled">
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-2">
|
||||
<div class="col">
|
||||
<p>Upgraded Precious Plastic v3 extruder, perfect for labs & small enterprises</p>
|
||||
<h3 id="features">Features</h3>
|
||||
<ul>
|
||||
<li>Rigid, flexible and modular framework – enabling hacking and extensions</li>
|
||||
<li>Extrusion hopper can be easily detached or turned down for cleaning</li>
|
||||
<li>Stronger taper bearings extra thrust bearings</li>
|
||||
<li>Alumunium hopper mount for extra cooling, enabling longer barrel usage</li>
|
||||
<li>All important and critical parts are CNC machined</li>
|
||||
<li>Electronics and wiring according to standards</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="clear:both"></div>
|
||||
<div style="padding:16px;text-align: center;">
|
||||
<div class="ty-vendor-plans">
|
||||
<div class="ty-grid-list__item" style="border: 1px gray;">
|
||||
<h4 id="authors">Specification</h4>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Lydia</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Version</td>
|
||||
<td>3.5</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Weight</td>
|
||||
<td>35KG</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Package Dimensions</td>
|
||||
<td>80 x 80 x 300 cm</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Screw Diameter</td>
|
||||
<td>25mm</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Barrel Diameter</td>
|
||||
<td>40mm</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Barrel Length</td>
|
||||
<td>42cm</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Voltage</td>
|
||||
<td>220V</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Speed / RPM at 50Hz</td>
|
||||
<td>50</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Gearbox</td>
|
||||
<td>1 – 30</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Motor Power</td>
|
||||
<td>1 kW</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Input Flake Size</td>
|
||||
<td>Small - Medium</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>License</td>
|
||||
<td><a href="https://ohwr.org/cernohl">CERN Open Source Hardware License</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
## Renderings
|
||||
|
||||
<div class="container my-4">
|
||||
<div class="row">
|
||||
<div class="col-md"><div style="width:100%; height:500px;margin:auto">{{%rGallery2%}}</div></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<hr />
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<a alt="Open Source Projects" href="https://git.polymech.io/">
|
||||
<img width="30px"
|
||||
src="https://assets.osr-plastic.org/assets/icons/github.png" />
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<a alt="" href="tel:0034691952287">
|
||||
<img width="30px"
|
||||
src="https://assets.osr-plastic.org/assets/icons/007-whatsapp.png" />
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<a alt="" href="mailto:sales@plastic-hub.com">
|
||||
<img width="30px"
|
||||
src="https://assets.osr-plastic.org/assets/icons/012-mail-2.png" />
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
5
packages/osr-code-bot/docs/tsconfig.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"extends": "astro/tsconfigs/strict",
|
||||
"include": [".astro/types.d.ts", "**/*"],
|
||||
"exclude": ["dist"]
|
||||
}
|
||||
4
packages/osr-code-bot/kbot-extensions/.gitignore
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
/node_modules
|
||||
/coverage
|
||||
*.log
|
||||
.DS_Store
|
||||
4
packages/osr-code-bot/kbot-extensions/.npmignore
Normal file
@ -0,0 +1,4 @@
|
||||
./docs
|
||||
./scripts
|
||||
./tests
|
||||
./incoming
|
||||
9
packages/osr-code-bot/kbot-extensions/LICENSE
Normal file
@ -0,0 +1,9 @@
|
||||
Copyright (c) <year> <owner> All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
2
packages/osr-code-bot/kbot-extensions/README.md
Normal file
@ -0,0 +1,2 @@
|
||||
# KBot - Extensions
|
||||
|
||||
@ -0,0 +1,66 @@
|
||||
Registering custom context menu items, like "Open With", for files on macOS is not directly supported through a high-level Node.js API. However, you can achieve this by creating a macOS Service or Automator script, and then invoking it via AppleScript with Node.js.
|
||||
|
||||
Here’s a broad outline of how you could implement a custom “Open With” functionality:
|
||||
|
||||
1. **Automator Workflow**: You can create an Automator workflow application to handle your specific action.
|
||||
|
||||
2. **AppleScript**: Use AppleScript to trigger this workflow from Node.js.
|
||||
|
||||
3. **Node.js**: Use `child_process` to run the AppleScript command.
|
||||
|
||||
### Step-by-Step Guide
|
||||
|
||||
#### Step 1: Create an Automator Application
|
||||
|
||||
1. **Open Automator** on your macOS.
|
||||
2. Create a new **"Application"**.
|
||||
3. Add actions to perform your custom task. For example, you could use the "Run Shell Script" or "Run JavaScript" actions to manipulate a file.
|
||||
4. Save the Automator application, e.g., `MyCustomOpenWith.app`.
|
||||
|
||||
#### Step 2: Create an AppleScript
|
||||
|
||||
Create an AppleScript that triggers your Automator Workflow. Save this as `openWith.scpt` somewhere accessible:
|
||||
|
||||
```applescript
|
||||
on open fileList
|
||||
tell application "Finder"
|
||||
repeat with aFile in fileList
|
||||
-- Replace the path below with the path to your Automator app
|
||||
do shell script "open -a '/path/to/MyCustomOpenWith.app' " & quoted form of (POSIX path of aFile)
|
||||
end repeat
|
||||
end tell
|
||||
end open
|
||||
```
|
||||
|
||||
#### Step 3: Execute AppleScript from Node.js
|
||||
|
||||
Use Node.js to execute AppleScript using the `child_process` module:
|
||||
|
||||
```javascript
|
||||
const { exec } = require('child_process');
|
||||
|
||||
function openWithCustomApp(filePath) {
|
||||
exec(`osascript /path/to/openWith.scpt ${filePath}`, (error, stdout, stderr) => {
|
||||
if (error) {
|
||||
console.error(`Error: ${error.message}`);
|
||||
return;
|
||||
}
|
||||
if (stderr) {
|
||||
console.error(`Stderr: ${stderr}`);
|
||||
return;
|
||||
}
|
||||
console.log(`Stdout: ${stdout}`);
|
||||
});
|
||||
}
|
||||
|
||||
// Example usage
|
||||
openWithCustomApp('/path/to/your/file.txt');
|
||||
```
|
||||
|
||||
### Note
|
||||
|
||||
- **Permissions**: macOS may prompt you to allow control of Finder or System Events depending on your script's actions. Make sure you grant these permissions for a smoother operation.
|
||||
- **AppleScript and Automator**: Familiarize yourself with basic AppleScript and Automator if customization goes beyond simple commands.
|
||||
- **Deployment**: If you plan to distribute this, ensure that paths and permissions are correctly resolved on user machines.
|
||||
|
||||
This approach is a workaround since macOS doesn’t provide direct APIs for modifying contextual menus through third-party applications like Node.js. For more advanced integration, you might need to delve into writing native macOS applications or using plugins specifically designed for this purpose.
|
||||
90
packages/osr-code-bot/kbot-extensions/docs/shell-ext/osx.md
Normal file
@ -0,0 +1,90 @@
|
||||
# Custom Context Menus (Open With) in macOS
|
||||
|
||||
There are several ways to register custom context menus ("Open With" options) in macOS.
|
||||
|
||||
## Method 1: Using Launch Services
|
||||
|
||||
This method uses macOS's built-in Launch Services feature:
|
||||
|
||||
1. Open System Preferences
|
||||
2. Go to Keyboard > Shortcuts > Services
|
||||
3. Create a new service in Automator
|
||||
|
||||
## Method 2: Using an Application Bundle
|
||||
|
||||
To register a custom application in the "Open With" menu, you need to create a proper application bundle with an `Info.plist` file.
|
||||
|
||||
```xml
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDocumentTypes</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>CFBundleTypeExtensions</key>
|
||||
<array>
|
||||
<string>txt</string>
|
||||
<string>md</string>
|
||||
</array>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>Text Document</string>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Editor</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.yourcompany.yourapp</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>YourApp</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
</dict>
|
||||
</plist>
|
||||
```
|
||||
|
||||
## Method 3: Using UTIs (Uniform Type Identifiers)
|
||||
|
||||
You can also register UTIs for your application to handle specific file types. Here's an example in Swift:
|
||||
|
||||
```swift
|
||||
import UniformTypeIdentifiers
|
||||
|
||||
class DocumentHandler: NSObject, UTIDocumentProvider {
|
||||
func document(withContentsOfURL url: URL,
|
||||
typeUti: String) throws -> AnyObject {
|
||||
// Handle the document here
|
||||
return NSString()
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Method 4: Using `defaults` Command
|
||||
|
||||
You can use the `defaults` command-line tool to associate file types with applications:
|
||||
|
||||
```bash
|
||||
# Associate .txt files with your app
|
||||
defaults write com.apple.TextEdit LSHandlers -txt
|
||||
your.app.bundle.identifier
|
||||
```
|
||||
|
||||
## Best Practices
|
||||
|
||||
1. Always provide clear file type associations in your `Info.plist`
|
||||
2. Use unique bundle identifiers
|
||||
3. Provide appropriate icons for your file types
|
||||
4. Implement proper error handling
|
||||
3. Test your implementation thoroughly
|
||||
|
||||
## Useful Tools
|
||||
|
||||
1. Xcode - For creating application bundles
|
||||
2. Automator - For creating simple services
|
||||
3. `lstype` command - For inspecting UTIs
|
||||
4. `defaults` command - For managing file associations
|
||||
|
||||
@ -0,0 +1,100 @@
|
||||
To create a custom context menu ("Open With") in Ubuntu using Node.js, you can modify desktop entry files and integrate your application into the GNOME or other Linux desktop environments. Here's how you can do it:
|
||||
|
||||
### Step-by-Step Guide
|
||||
|
||||
1. **Create a Desktop Entry File:**
|
||||
This file registers your application with the system so you can define how it should appear in the context menu.
|
||||
|
||||
2. **Use Node.js to Automate the Setup:**
|
||||
Create a Node.js script that writes the necessary desktop entry.
|
||||
|
||||
Here’s a simple example to register a custom application that opens files with a specific extension using your Node.js script:
|
||||
|
||||
### Example Code
|
||||
|
||||
1. **Create the Script:**
|
||||
|
||||
```javascript
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
// Define your application details
|
||||
const appName = 'My Custom App';
|
||||
const execPath = '/usr/bin/my-custom-app'; // Adjust this to your actual executable path
|
||||
const mimeType = 'text/plain'; // Specify the MIME type your app can handle
|
||||
|
||||
// Define the path for the desktop entry
|
||||
const desktopEntryPath = path.join(process.env.HOME, '.local', 'share', 'applications', 'my-custom-app.desktop');
|
||||
|
||||
// Craft the content of the .desktop file
|
||||
const desktopEntryContent = `
|
||||
[Desktop Entry]
|
||||
Name=${appName}
|
||||
Comment=Open with My Custom App
|
||||
Exec=${execPath} %U
|
||||
Terminal=false
|
||||
Type=Application
|
||||
MimeType=${mimeType};
|
||||
`;
|
||||
|
||||
function createDesktopEntry() {
|
||||
// Ensure the target directory exists
|
||||
const dirPath = path.dirname(desktopEntryPath);
|
||||
if (!fs.existsSync(dirPath)) {
|
||||
fs.mkdirSync(dirPath, { recursive: true });
|
||||
}
|
||||
|
||||
// Write the desktop entry file
|
||||
fs.writeFileSync(desktopEntryPath, desktopEntryContent.trim(), { mode: 0o644 });
|
||||
console.log(`Desktop entry created at: ${desktopEntryPath}`);
|
||||
}
|
||||
|
||||
// Execute the function
|
||||
createDesktopEntry();
|
||||
```
|
||||
|
||||
2. **Register MIME Type:**
|
||||
|
||||
- Ensure the MIME type is recognized by your system. If your application handles a unique file type, you might need to create a custom MIME type in your system as below.
|
||||
|
||||
- **Create a MIME Type XML file** (e.g., `my-custom-app.xml`):
|
||||
|
||||
```xml
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
|
||||
<mime-type type="application/x-my-custom-file">
|
||||
<comment>My Custom File</comment>
|
||||
<glob pattern="*.myext"/>
|
||||
</mime-type>
|
||||
</mime-info>
|
||||
```
|
||||
|
||||
- **Install the MIME Type:**
|
||||
|
||||
```bash
|
||||
xdg-mime install my-custom-app.xml
|
||||
```
|
||||
|
||||
- **Associate your application with this MIME type**:
|
||||
|
||||
```bash
|
||||
xdg-mime default my-custom-app.desktop application/x-my-custom-file
|
||||
```
|
||||
|
||||
3. **Refresh the System Database:**
|
||||
|
||||
Update the system database using update-desktop-database. Ensure this command is available on your system:
|
||||
|
||||
```bash
|
||||
update-desktop-database ~/.local/share/applications
|
||||
```
|
||||
|
||||
### Considerations
|
||||
|
||||
- **Permissions:** Ensure that the user has sufficient permissions to create and modify files in `~/.local/share/applications`.
|
||||
|
||||
- **Executable Path:** The executable path (`/usr/bin/my-custom-app`) must point to an actual executable or script you want to run.
|
||||
|
||||
- **MimeType:** Adjust the mimeType field to match the file types your app should handle.
|
||||
|
||||
With these steps, your custom application should appear in the "Open With" context menu for the specified MIME type files. You can further test, enhance, and refine the script according to your needs and environment.
|
||||
@ -0,0 +1,81 @@
|
||||
# Custom "Open With" Menu Integration in Ubuntu
|
||||
|
||||
## Method 1: Using .desktop Files
|
||||
|
||||
To add a custom application to the "Open With" context menu, you can create a .desktop file.
|
||||
|
||||
1. Create a .desktop file in `~/.local/share/applications` or `/usr/share/applications`:
|
||||
|
||||
```
|
||||
# Example: CustomEditor.desktop
|
||||
[Desktop Entry]
|
||||
Version=1.0
|
||||
Name=Custom Editor
|
||||
Comment=Open files with my custom editor
|
||||
Exec=/usr/local/bin/my-editor %f
|
||||
Icon=/usr/share/icons/my-editor.png
|
||||
Terminal=false
|
||||
Type=Application
|
||||
MimeType=text/plain;text/markdown;
|
||||
Categories=Utility;TextEditor;
|
||||
```
|
||||
|
||||
## Method 2: Using XDG Mime Database
|
||||
|
||||
You can also modify the XDG MIME database to associate file types with your application:
|
||||
|
||||
```bash
|
||||
# Update the MIME by association
|
||||
xdg-mime --default-apps my-editor.desktop text/plain
|
||||
|
||||
# Update the database
|
||||
update-desktop-database
|
||||
```
|
||||
|
||||
## Method 3: Using Filemanager Actions (Nautilus)
|
||||
|
||||
You can add custom actions to Nautilus by creating a script in `~/.local/share/nautilus/scripts`:
|
||||
|
||||
```bash
|
||||
#!/bin/bash
|
||||
# Save this as ~/.local/share/nautilus/scripts/custom-opener
|
||||
|
||||
for f in "$@"; do
|
||||
my-editor "$f"
|
||||
done
|
||||
```
|
||||
|
||||
Make the script executable:
|
||||
|
||||
```bash
|
||||
chmod +x ~/.local/share/nautilus/scripts/custom-opener
|
||||
```
|
||||
|
||||
## Method 4: mimeapps.list Configuration
|
||||
|
||||
You can modify the `~/.config/mimeapps.list` file:
|
||||
|
||||
```
|
||||
# Add lines like this:
|
||||
text/plain=my-editor.desktop;vim.desktop;gedit.desktop
|
||||
```
|
||||
|
||||
## Key File Locations
|
||||
|
||||
- System-wide applications: `/usr/share/applications`
|
||||
- User-specific applications: `~/.local/share/applications`
|
||||
- MIME type definitions: `/usr/share/mime/packages`
|
||||
- User-specific MIME overrides: `~/.config/mimeapps.list`
|
||||
- Nautilus scripts: `~/.local/share/nautilus/scripts`
|
||||
|
||||
## Important Notes
|
||||
|
||||
1. After making changes, you may need to:
|
||||
- Run `update-desktop-database`
|
||||
- Log out and back in
|
||||
- Restart Nautilus with `killall nautilus`
|
||||
|
||||
2. For .desktop files, make sure:
|
||||
- The file has execute permissions (`u+x`)
|
||||
- The `Exec` path is correct
|
||||
- The `MimeType` list is appropriate for your application
|
||||
@ -0,0 +1,84 @@
|
||||
Registering custom context menus (like "Open With" options) in Windows using Node.js involves modifying the Windows Registry, as that's where Windows stores configuration data for the context menu.
|
||||
|
||||
Below are options and example code snippets that show how to achieve this using Node.js. Remember, modifying the Windows Registry can have significant effects on your system, so proceed with caution and back up the registry before making changes.
|
||||
|
||||
### Prerequisites
|
||||
|
||||
You need to have Node.js installed on your machine and optionally, you might want to use a package that makes interacting with the Windows Registry easier, such as [node-winreg](https://github.com/fresc81/node-winreg).
|
||||
|
||||
### Option 1: Using the `node-winreg` package
|
||||
|
||||
1. **Install the package:**
|
||||
|
||||
```bash
|
||||
npm install winreg
|
||||
```
|
||||
|
||||
2. **Example Code to Add a Context Menu Entry:**
|
||||
|
||||
```javascript
|
||||
const Registry = require('winreg');
|
||||
|
||||
// Define new registry entry
|
||||
const regKey = new Registry({
|
||||
hive: Registry.HKCR, // HKEY_CLASSES_ROOT
|
||||
key: '\\*\\shell\\MyCustomAction' // Use '\\Folder' for folder context
|
||||
});
|
||||
|
||||
// Set the description of your context menu item
|
||||
regKey.set('', Registry.REG_SZ, 'Open with MyApp', (err) => {
|
||||
if (err) throw err;
|
||||
console.log('Context menu description set.');
|
||||
|
||||
// Define the command key to execute
|
||||
const commandKey = new Registry({
|
||||
hive: Registry.HKCR,
|
||||
key: '\\*\\shell\\MyCustomAction\\command'
|
||||
});
|
||||
|
||||
// Set the command that the context menu item executes
|
||||
commandKey.set('', Registry.REG_SZ, '"C:\\path\\to\\your\\app.exe" "%1"', (err) => {
|
||||
if (err) throw err;
|
||||
console.log('Command set for context menu.');
|
||||
});
|
||||
});
|
||||
```
|
||||
|
||||
### Option 2: Using Windows Registry Command Line (reg.exe)
|
||||
|
||||
This method involves executing Windows' built-in registry manipulation tool using Node.js's `child_process` module.
|
||||
|
||||
1. **Example Code to Add a Context Menu Entry:**
|
||||
|
||||
```javascript
|
||||
const { exec } = require('child_process');
|
||||
|
||||
// Define the registry command
|
||||
const regAddCommand = `
|
||||
reg add HKCR\\*\\shell\\MyCustomAction /ve /d "Open with MyApp" /f &&
|
||||
reg add HKCR\\*\\shell\\MyCustomAction\\command /ve /d "\\"C:\\\\path\\\\to\\\\your\\\\app.exe\\" \\"%1\\"" /f
|
||||
`;
|
||||
|
||||
// Execute the command
|
||||
exec(regAddCommand, (error, stdout, stderr) => {
|
||||
if (error) {
|
||||
console.error(`Error: ${error.message}`);
|
||||
return;
|
||||
}
|
||||
if (stderr) {
|
||||
console.error(`Stderr: ${stderr}`);
|
||||
return;
|
||||
}
|
||||
console.log('Context menu entry added successfully.');
|
||||
});
|
||||
```
|
||||
|
||||
### Important Considerations
|
||||
|
||||
- **Permissions:** You will need administrative privileges to modify certain parts of the Windows Registry. Running Node.js or Command Prompt as an administrator may be necessary.
|
||||
|
||||
- **System Impact:** Incorrect changes to the registry can cause system instability. Always back up the registry before making modifications.
|
||||
|
||||
- **Uninstalling:** When distributing applications, consider providing a way to remove the context menu entries created, perhaps by running a script with similar logic but using `reg delete` or `registry.remove`.
|
||||
|
||||
These examples provide a basic implementation. Depending on your requirements, you might need to adjust paths and keys or add error handling as needed.
|
||||
@ -0,0 +1,72 @@
|
||||
To register custom context menus (like "Open with") in Windows, you typically need to make changes to the Windows Registry. Below are some options and example code snippets you can use to achieve this. Keep in mind that editing the Windows Registry can have significant effects on your system, so proceed with caution and back up the registry before making any modifications.
|
||||
|
||||
### Option 1: Manually Editing the Windows Registry
|
||||
|
||||
1. **Open the Registry Editor**:
|
||||
- Press `Win + R`, type `regedit`, and hit Enter.
|
||||
|
||||
2. **Navigate to the file type you want to add the context menu for**:
|
||||
- For example, for `.txt` files, navigate to `HKEY_CLASSES_ROOT\txtfile\shell`.
|
||||
|
||||
3. **Add a new key**:
|
||||
- Right-click on `shell`, select `New > Key`, and name it as you like (e.g., `OpenWithMyApp`).
|
||||
|
||||
4. **Define the menu text**:
|
||||
- Click on the newly created key, and in the right pane, double-click the `(Default)` value to set the menu name (e.g., "Open with MyApp").
|
||||
|
||||
5. **Specify the command to run**:
|
||||
- Right-click on your new key (e.g., `OpenWithMyApp`), select `New > Key`, and name it `command`.
|
||||
- Set the `(Default)` value of the `command` key to the application executable you want to run, including any necessary parameters.
|
||||
- Example for a simple application:
|
||||
```plaintext
|
||||
"C:\Path\To\MyApp.exe" "%1"
|
||||
```
|
||||
|
||||
### Option 2: Using a Batch Script to Add Entries
|
||||
|
||||
You can automate the process of adding registry entries using a batch file. Here's an example batch script that adds a new context menu entry for `.txt` files.
|
||||
|
||||
```batch
|
||||
@echo off
|
||||
SET KEY_NAME="HKEY_CLASSES_ROOT\txtfile\shell\OpenWithMyApp"
|
||||
SET COMMAND_KEY="HKEY_CLASSES_ROOT\txtfile\shell\OpenWithMyApp\command"
|
||||
SET APP_PATH="C:\Path\To\MyApp.exe"
|
||||
|
||||
REM Add the shell key
|
||||
REG ADD %KEY_NAME% /ve /d "Open with MyApp" /f
|
||||
|
||||
REM Add the command key
|
||||
REG ADD %COMMAND_KEY% /ve /d "\"%APP_PATH%\" \"%%1\"" /f
|
||||
|
||||
echo Context menu entry added successfully.
|
||||
```
|
||||
|
||||
### Option 3: Using PowerShell Script
|
||||
|
||||
You can also use PowerShell to add entries to the registry:
|
||||
|
||||
```powershell
|
||||
$FileType = "txtfile"
|
||||
$MenuText = "Open with MyApp"
|
||||
$AppPath = "C:\Path\To\MyApp.exe"
|
||||
|
||||
# Define the paths
|
||||
$ShellPath = "HKCR:\$FileType\shell\$MenuText"
|
||||
$CommandPath = "$ShellPath\command"
|
||||
|
||||
# Create the keys and set values
|
||||
New-Item -Path $ShellPath -Force | Out-Null
|
||||
Set-ItemProperty -Path $ShellPath -Name "(Default)" -Value $MenuText
|
||||
|
||||
New-Item -Path $CommandPath -Force | Out-Null
|
||||
Set-ItemProperty -Path $CommandPath -Name "(Default)" -Value "`"$AppPath`" `"%1`""
|
||||
```
|
||||
|
||||
### Caveats and Notes
|
||||
|
||||
- **Administrative Privileges**: Both the batch and PowerShell scripts might need to be run with administrative privileges to make changes to the registry.
|
||||
- **Path Accuracy**: Ensure that the path to your application executable is correct and accessible.
|
||||
- **Backup**: Always back up the registry before making changes.
|
||||
- **Testing**: After running scripts, right-click a file of the type you've modified and verify that the new context menu appears and functions as expected.
|
||||
|
||||
By creating these registry entries, you can customize Windows' context menus to streamline workflows and improve the user experience for specific file types.
|
||||
2
packages/osr-code-bot/kbot-extensions/gui/kbot/.gitattributes
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
*.scss linguist-detectable=false
|
||||
*.sass linguist-detectable=false
|
||||
13
packages/osr-code-bot/kbot-extensions/gui/kbot/.github/FUNDING.yml
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
||||
patreon: # Replace with a single Patreon username
|
||||
open_collective: # Replace with a single Open Collective username
|
||||
ko_fi: guasam
|
||||
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
||||
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
||||
liberapay: # Replace with a single Liberapay username
|
||||
issuehunt: # Replace with a single IssueHunt username
|
||||
otechie: # Replace with a single Otechie username
|
||||
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
|
||||
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
||||
86
packages/osr-code-bot/kbot-extensions/gui/kbot/.gitignore
vendored
Normal file
@ -0,0 +1,86 @@
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
lerna-debug.log*
|
||||
|
||||
# Diagnostic reports (https://nodejs.org/api/report.html)
|
||||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
||||
|
||||
# Runtime data
|
||||
pids
|
||||
*.pid
|
||||
*.seed
|
||||
*.pid.lock
|
||||
.DS_Store
|
||||
|
||||
# Directory for instrumented libs generated by jscoverage/JSCover
|
||||
lib-cov
|
||||
|
||||
# Coverage directory used by tools like istanbul
|
||||
coverage
|
||||
*.lcov
|
||||
|
||||
# nyc test coverage
|
||||
.nyc_output
|
||||
|
||||
# node-waf configuration
|
||||
.lock-wscript
|
||||
|
||||
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
||||
build/Release
|
||||
|
||||
# Dependency directories
|
||||
node_modules/
|
||||
jspm_packages/
|
||||
|
||||
# TypeScript cache
|
||||
*.tsbuildinfo
|
||||
|
||||
# Optional npm cache directory
|
||||
.npm
|
||||
|
||||
# Optional eslint cache
|
||||
.eslintcache
|
||||
|
||||
# Optional REPL history
|
||||
.node_repl_history
|
||||
|
||||
# Output of 'npm pack'
|
||||
*.tgz
|
||||
|
||||
# Yarn Integrity file
|
||||
.yarn-integrity
|
||||
|
||||
# dotenv environment variables file
|
||||
.env
|
||||
.env.test
|
||||
|
||||
# parcel-bundler cache (https://parceljs.org/)
|
||||
.cache
|
||||
|
||||
# next.js build output
|
||||
.next
|
||||
|
||||
# nuxt.js build output
|
||||
.nuxt
|
||||
|
||||
# vuepress build output
|
||||
.vuepress/dist
|
||||
|
||||
# Serverless directories
|
||||
.serverless/
|
||||
|
||||
# FuseBox cache
|
||||
.fusebox/
|
||||
|
||||
# DynamoDB Local files
|
||||
.dynamodb/
|
||||
|
||||
# Webpack
|
||||
.webpack/
|
||||
|
||||
# Electron-Forge
|
||||
out/
|
||||
@ -0,0 +1,5 @@
|
||||
{
|
||||
"singleQuote": true,
|
||||
"trailingComma": "all",
|
||||
"jsxSingleQuote": true
|
||||
}
|
||||
567
packages/osr-code-bot/kbot-extensions/gui/kbot/CHANGELOG.md
Normal file
@ -0,0 +1,567 @@
|
||||
# Change Log
|
||||
|
||||
All notable changes to the project are listed here.
|
||||
|
||||
For more information visit:
|
||||
https://github.com/codesbiome/electron-react-webpack-typescript-2024
|
||||
|
||||
<br>
|
||||
|
||||
### v8.1.0
|
||||
|
||||
- 🎉 Electron version upgraded `v23.0.0`.
|
||||
- Using `eslint.config.json` as eslint configuration.
|
||||
- Tweaked app themes colors.
|
||||
- Upgraded outdated packages:
|
||||
|
||||
| Package | Version |
|
||||
| ------------------------------------ | --------- |
|
||||
| electron | `^31.2.1` |
|
||||
| @electron-forge | `7.4.0` |
|
||||
| electron-squirrel-startup | `^1.0.1` |
|
||||
| @pmmmwh/react-refresh-webpack-plugin | `^0.5.15` |
|
||||
| @typescript-eslint | `^7.16.1` |
|
||||
| css-loader | `^7.1.2` |
|
||||
| eslint | `^9.7.0` |
|
||||
| eslint-plugin-react | `^7.34.4` |
|
||||
| react-refresh | `^0.14.2` |
|
||||
| sass | `^1.77.8` |
|
||||
| sass-loader | `^14.2.1` |
|
||||
| style-loader | `^4.0.0` |
|
||||
| typescript | `^5.5.3` |
|
||||
| webpack | `^5.93.0` |
|
||||
| react | `^18.3.1` |
|
||||
| react-dom | `^18.3.1` |
|
||||
|
||||
<br>
|
||||
|
||||
### v8.0.0
|
||||
|
||||
- 🎉 Application UI and Themes (light/dark).
|
||||
- Using latest Electron version `v28`
|
||||
- Changed app accent colors & added credits menu item.
|
||||
- Integrated `electron-window` components & modules in project's file structure.
|
||||
- Separated dark/light themes from application stylesheet for easy modification.
|
||||
- Added `@styles` alias for easily import stylesheets.
|
||||
- Removed `less-loader` by default from project.
|
||||
- Removed unused `misc` directory.
|
||||
- Removed unused `src/common` directory.
|
||||
- Converted `less` to `scss` for window components stylesheet.
|
||||
- Updated forge config with more useful hints.
|
||||
- Upgraded outdated packages to their latest supported versions.
|
||||
|
||||
<br>
|
||||
|
||||
### v7.8.0
|
||||
|
||||
Upgraded outdated packages:
|
||||
|
||||
| Package | Version |
|
||||
| ------------------------------ | -------- |
|
||||
| electron | `27.1.2` |
|
||||
| @electron-forge | `7.1.0` |
|
||||
| @typescript-eslint | `6.13.1` |
|
||||
| eslint-plugin-import | `2.29.0` |
|
||||
| eslint | `8.54.0` |
|
||||
| less | `4.2.0` |
|
||||
| sass | `1.69.5` |
|
||||
| ts-loader | `9.5.1` |
|
||||
| typescript | `5.3.2` |
|
||||
| webpack | `5.89.0` |
|
||||
| react-refresh-webpack-plugin | `0.5.11` |
|
||||
| fork-ts-checker-webpack-plugin | `9.0.2` |
|
||||
|
||||
<br>
|
||||
|
||||
### v7.7.0
|
||||
|
||||
Upgraded outdated packages:
|
||||
|
||||
| Package | Version |
|
||||
| ---------------------------- | -------- |
|
||||
| electron | `26.2.2` |
|
||||
| @electron-forge | `6.4.2` |
|
||||
| @typescript-eslint | `6.7.3` |
|
||||
| eslint-plugin-import | `2.28.1` |
|
||||
| eslint-plugin-react | `7.33.2` |
|
||||
| eslint | `8.50.0` |
|
||||
| less | `4.2.0` |
|
||||
| sass | `1.68.0` |
|
||||
| typescript | `5.2.2` |
|
||||
| webpack | `5.88.2` |
|
||||
| react-refresh-webpack-plugin | `0.5.11` |
|
||||
|
||||
<br>
|
||||
|
||||
### v7.6.0
|
||||
|
||||
Upgraded outdated packages:
|
||||
|
||||
| Package | Version |
|
||||
| ------------------ | -------- |
|
||||
| electron | `25.2.0` |
|
||||
| @electron-forge | `6.2.1` |
|
||||
| @typescript-eslint | `6.0.0` |
|
||||
| eslint | `8.44.0` |
|
||||
| less-loader | `11.1.3` |
|
||||
| sass | `1.63.6` |
|
||||
| sass-loader | `13.3.2` |
|
||||
| ts-loader | `9.4.4` |
|
||||
| typescript | `5.1.6` |
|
||||
| webpack | `5.88.1` |
|
||||
|
||||
<br>
|
||||
|
||||
### v7.5.0
|
||||
|
||||
Upgraded outdated packages:
|
||||
|
||||
| Package | Version |
|
||||
| ------------------ | -------- |
|
||||
| electron | `25.0.1` |
|
||||
| @typescript-eslint | `5.59.9` |
|
||||
| css-loader | `6.8.1` |
|
||||
| eslint | `8.42.0` |
|
||||
| less-loader | `11.1.2` |
|
||||
| sass | `1.62.1` |
|
||||
| sass-loader | `13.3.1` |
|
||||
| style-loader | `3.3.3` |
|
||||
| ts-loader | `9.4.3` |
|
||||
| typescript | `5.1.3` |
|
||||
| webpack | `5.85.1` |
|
||||
|
||||
<br>
|
||||
|
||||
### v7.3.3
|
||||
|
||||
Upgraded outdated packages:
|
||||
|
||||
| Package | Version | |
|
||||
| ------------------ | -------- | --- |
|
||||
| electron | `24.1.2` | ⬆️ |
|
||||
| @electron-forge | `6.1.1` | ⬆️ |
|
||||
| @typescript-eslint | `5.59.0` | ⬆️ |
|
||||
| eslint | `8.39.0` | ⬆️ |
|
||||
| sass | `1.62.0` | ⬆️ |
|
||||
| sass-loader | `13.2.2` | ⬆️ |
|
||||
| typescript | `5.0.4` | ⬆️ |
|
||||
| webpack | `5.80.0` | ⬆️ |
|
||||
|
||||
<br>
|
||||
|
||||
### v7.3.2
|
||||
|
||||
Upgraded outdated packages:
|
||||
|
||||
| Package | Version | |
|
||||
| ------------------ | ---------- | --- |
|
||||
| electron | `23.2.0` | ⬆️ |
|
||||
| eslint | `8.36.0` | ⬆️ |
|
||||
| sass | `1.60.0` | ⬆️ |
|
||||
| sass-loader | `13.2.1` | ⬆️ |
|
||||
| style-loader | `3.3.2` | ⬆️ |
|
||||
| typescript | `5.0.2` | ⬆️ |
|
||||
| webpack | `5.76.3` | ⬆️ |
|
||||
| @types/node | `18.15.10` | ⬆️ |
|
||||
| @types/react | `18.0.29` | ⬆️ |
|
||||
| @types/react-dom | `18.0.11` | ⬆️ |
|
||||
| @typescript-eslint | `5.56.0` | ⬆️ |
|
||||
|
||||
<br>
|
||||
|
||||
### v7.3.1
|
||||
|
||||
Upgraded outdated packages:
|
||||
|
||||
| Package | Version | |
|
||||
| ------------------ | --------- | --- |
|
||||
| electron | `23.1.2` | ⬆️ |
|
||||
| eslint | `8.35.0` | ⬆️ |
|
||||
| sass | `1.58.3` | ⬆️ |
|
||||
| @types/node | `18.14.6` | ⬆️ |
|
||||
| @types/react | `18.0.28` | ⬆️ |
|
||||
| @types/react-dom | `18.0.11` | ⬆️ |
|
||||
| @typescript-eslint | `5.54.0` | ⬆️ |
|
||||
|
||||
<br>
|
||||
|
||||
### v7.3.0
|
||||
|
||||
- 🎉 Electron version upgraded `v23.0.0`
|
||||
- Upgraded outdated packages:
|
||||
- `electron` upgraded to `v23.0.0`
|
||||
- `@electron-forge` deps upgraded to `v6.0.5`
|
||||
- `@typescript-eslint` deps upgraded to `v5.51.0`
|
||||
- `css-loader` upgraded to `v6.7.3`
|
||||
- `eslint` upgraded to `v8.33.0`
|
||||
- `eslint-plugin-import` upgraded to `v2.27.5`
|
||||
- `eslint-plugin-react` upgraded to `v7.32.2`
|
||||
- `fork-ts-checker-webpack-plugin` upgraded to `v7.3.0`
|
||||
- `sass` upgraded to `v1.58.0`
|
||||
- `typescript` upgraded to `v4.9.5`
|
||||
|
||||
<br>
|
||||
|
||||
### v7.2.0
|
||||
|
||||
- 🎉 Electron version upgraded `v22.0.0`
|
||||
- Upgraded outdated packages:
|
||||
- `electron` upgraded to `v22.0.0`
|
||||
- `@electron-forge` deps upgraded to `v6.0.4`
|
||||
- `@pmmmwh/react-refresh-webpack-plugin` upgraded to `v0.5.10`
|
||||
- `@typescript-eslint` deps upgraded to `v5.46.0`
|
||||
- `css-loader` upgraded to `v6.7.2`
|
||||
- `eslint` upgraded to `v8.29.0`
|
||||
- `sass-loader` upgraded to `v13.2.0`
|
||||
- `ts-loader` upgraded to `v9.4.2`
|
||||
- `typescript` upgraded to `v4.9.4`
|
||||
- `webpack` upgraded to `v5.75.0`
|
||||
|
||||
<br>
|
||||
|
||||
### v7.1.0
|
||||
|
||||
- 🎉 Electron version upgraded to `v21.2.0`
|
||||
- Fixed Devtools Console warning message caused by content policy.
|
||||
- Upgraded forge config plugins format to support latest version.
|
||||
- Disabled `sandbox` by default in application window.
|
||||
- Upgraded outdated deps:
|
||||
- `electron` upgraded to `v21.2.0`
|
||||
- `@electron-forge` deps upgraded to `v6.0.0-beta.68`
|
||||
- `@pmmmwh/react-refresh-webpack-plugin` upgraded to `v0.5.8`
|
||||
- `@typescript-eslint` deps upgraded to `v5.41.0`
|
||||
- `classnames` upgraded to `v2.3.2`
|
||||
- `eslint` upgraded to `v8.26.0`
|
||||
- `eslint-plugin-react` upgraded to `v7.31.10`
|
||||
- `less-loader` upgraded to `v11.1.0`
|
||||
- `sass` upgraded to `v1.55.0`
|
||||
- `sass-loader` upgraded to `v13.1.0`
|
||||
- `ts-loader` upgraded to `v9.4.1`
|
||||
- `typescript` upgraded to `v4.8.4`
|
||||
|
||||
<br>
|
||||
|
||||
### v7.0.0
|
||||
|
||||
- 🥳 New layout for default application.
|
||||
- 🤖 Overhaul for dark/light themes with new colors.
|
||||
- Improved transition timing of title menus list.
|
||||
- Fixed native modules compiling issue with update to related webpack loader.
|
||||
- Updated forge `devContentSecurityPolicy` config for electron window.
|
||||
- Upgraded outdated deps:
|
||||
- `electron` upgraded to `v19.0.14`
|
||||
- `@electron-forge` deps upgraded to `v6.0.0-beta.65`
|
||||
- `@typescript-eslint` deps upgraded to `v5.36.1`
|
||||
- `eslint` upgraded to `v8.23.0`
|
||||
- `eslint-plugin-react` upgraded to `v7.30.1`
|
||||
- `sass` upgrded to `v1.54.0`
|
||||
- `typescript` upgraded to `v4.7.4`
|
||||
|
||||
<br>
|
||||
|
||||
### v6.2.0
|
||||
|
||||
- Upgraded outdated deps:
|
||||
- `electron` upgraded to `^19.0.9`.
|
||||
- `@typescript-eslint` deps upgraded to `v5.30.7`.
|
||||
- `eslint` upgraded to `v8.20.0"`.
|
||||
- `fork-ts-checker-webpack-plugin` upgraded to `v7.2.13`.
|
||||
- `sass` upgraded to `v1.54.0`.
|
||||
- `sass-loader` upgraded to `v13.0.2`.
|
||||
- `webpack` upgraded to `v5.74.0`.
|
||||
|
||||
<br>
|
||||
|
||||
### v6.1.0
|
||||
|
||||
- 🎉 Electron version upgraded to `v19.0.6`
|
||||
- Using `misc/window` for custom window without git submodule.
|
||||
- Upgraded outdated deps:
|
||||
- `electron` upgraded to `v19.0.6`
|
||||
- `@electron-forge` deps upgraded to `v6.0.0-beta.64`
|
||||
- `@pmmmwh/react-refresh-webpack-plugin` upgraded to `v0.5.7`
|
||||
- `@types` deps upgraded to latest version
|
||||
- `@typescript-eslint` deps upgraded to `v5.29.0`
|
||||
- `eslint` upgraded to `v8.18.0`
|
||||
- `eslint-plugin-react` upgraded to `v7.30.1`
|
||||
- `fork-ts-checker-webpack-plugin` upgraded to `v7.2.11`
|
||||
- `less` upgraded to `v4.1.3`
|
||||
- `less-loader` upgraded to `v11.0.0`
|
||||
- `react-refresh` upgraded to `v0.14.0`
|
||||
- `sass` upgraded to `v1.53.0`
|
||||
- `sass-loader` upgraded to `v13.0.1`
|
||||
- `ts-loader` upgraded to `v9.3.1`
|
||||
- `typescript` upgraded to `v4.7.4`
|
||||
- `webpack` upgraded to `5.73.0`
|
||||
|
||||
<br>
|
||||
|
||||
### v6.0.0
|
||||
|
||||
- 🙌🏻 New Layout for default application.
|
||||
- 🌑 Dark mode & 💡 Light Mode colors.
|
||||
- 🎉 Electron version upgraded to `v18.1.0`
|
||||
- Using `sass/scss` stylesheets by default for project (previously `less` was used).
|
||||
- Using `React Fast Refresh` for hot reloading, removed old `hot-loader`.
|
||||
- Titlebar Menus style overrides for improvements with rounded corners.
|
||||
- Created a new `Theme.scss` file for adjusting light/dark mode color schemes.
|
||||
- Persist theme state in `localStorage` by default.
|
||||
- Using `pnpm` instead of `yarn` as package manager for project.
|
||||
- Upgraded outdated deps:
|
||||
- `electron` upgraded to `v18.1.0`
|
||||
- `eslint` upgraded to `v8.13.0`
|
||||
- `typescript` upgraded to `v4.6.3`
|
||||
- `webpack` upgraded to `v5.72.0`
|
||||
- `react` deps upgraded to `v18.0.0`
|
||||
|
||||
<br>
|
||||
|
||||
### v5.5.0
|
||||
|
||||
- Upgraded outdated deps:
|
||||
- `electron` upgraded to `v17.2.0`
|
||||
- `eslint` ugpraded to `v8.11.0`,
|
||||
- `css-loader` upgraded to `v6.7.1`
|
||||
- `@typescript-eslint/eslint-plugin` deps upgraded to `v5.16.0`
|
||||
- `eslint-plugin-react` upgraded to `v7.29.4`
|
||||
- `ts-loader` upgraded to `v9.2.8`
|
||||
- `typescript` upgraded to `v4.6.3`
|
||||
- `webpack` upgraded to `v5.70.0`
|
||||
|
||||
<br>
|
||||
|
||||
### v5.4.0
|
||||
|
||||
- 🎉 Electron core upgraded `v17.0.1`
|
||||
- Upgraded outdated deps:
|
||||
- `@hot-loader/react-dom` upgraded to `v17.0.2`
|
||||
- `webpack` upgraded to `v5.69.1`
|
||||
- `typescript` upgraded to `v4.5.5`
|
||||
- `fork-ts-checker-webpack-plugin` upgraded to `v7.2.1`
|
||||
- `eslint` upgraded to `v8.9.0`
|
||||
- `css-loader` upgraded to `v6.6.0`
|
||||
- `@typescript-eslint` deps upgraded to `v5.12.1`
|
||||
|
||||
<br>
|
||||
|
||||
### v5.3.0
|
||||
|
||||
- Electron Window : File menu visible by default
|
||||
- Upgraded outdated deps:
|
||||
- `electron` upgraded to `v16.0.7`
|
||||
- `@electron-forge` deps upgraded to `v6.0.0-beta.63`
|
||||
- `@types/node` upgraded to `v17.0.8`
|
||||
- `@typescript-eslint` deps upgraded to `v5.9.1`
|
||||
- `eslint` upgraded to `v8.6.0`
|
||||
- `typescript` upgraded to `v4.5.4`
|
||||
- `webpack` upgraded to `v5.66.0`
|
||||
|
||||
<br>
|
||||
|
||||
### v5.2.0
|
||||
|
||||
- 🎉 Electron core upgraded `v16`
|
||||
- Upgraded outdated deps:
|
||||
- `@typescript-eslint` deps upgraded to `^5.5.0`
|
||||
- `eslint` upgraded to `^8.4.0`
|
||||
- `fork-ts-checker-webpack-plugin` upgraded to `^6.5.0`
|
||||
- `typescript` upgraded to `^4.5.2`
|
||||
- `webpack` upgraded to `^5.64.4`
|
||||
|
||||
<br>
|
||||
|
||||
### v5.1.0
|
||||
|
||||
- Fix: CSS/LESS `background-image` corrupted image file output.
|
||||
- Updated: Webpack Rules to load assets using [Webpack v5 Asset Modules](https://webpack.js.org/guides/asset-modules/) instead of `file-loader`
|
||||
- Fix: Typo in eslint alias map for `@components`
|
||||
- Updated: Window (submodule) to latest version.
|
||||
- Removed: Unused contextBridge api declaration.
|
||||
|
||||
<br>
|
||||
|
||||
### v5.0.0
|
||||
|
||||
- Overhauled: Application default layout and styling.
|
||||
- Overhauled: Project files structure to separate 'main' & 'renderer' modules.
|
||||
- Added: Custom Window Frame.
|
||||
- Added: Custom Window Titlebar.
|
||||
- Added: Custom Menus for Titlebar.
|
||||
- Added: Window controls for `windows` & `mac` based platform.
|
||||
- Renamed: `.eslintrc.json` to `.eslintrc`
|
||||
- Upgraded Outdated deps :
|
||||
- `eslint` upgraded to `v8.2.0`
|
||||
- `css-loader` upgraded to `v6.5.1`
|
||||
- `@typescript-eslint` deps upgraded to `v5.3.0`
|
||||
- `webpack` upgraded to `v5.62.1`
|
||||
|
||||
<br>
|
||||
|
||||
### v4.2.0
|
||||
|
||||
- 🎉 Electron core upgraded to version `v15`
|
||||
- Application colors updated for vue environment
|
||||
- Fix eslint script
|
||||
- Default window background color updated.
|
||||
- Upgrade outdated deps:
|
||||
- `electron` upgraded to `^15.0.0`
|
||||
- `@electron-forge` deps upgraded to `6.0.0-beta.61`
|
||||
- `@types/node` upgraded to `^16.9.6`
|
||||
- `@typescript-eslint` deps upgraded to `^4.31.2`
|
||||
- `css-loader` upgraded to `^6.3.0`
|
||||
|
||||
<br>
|
||||
|
||||
### v4.1.0
|
||||
|
||||
- 🎉 Electron core upgraded to version `v14`
|
||||
- Update application style properties
|
||||
- Enable `nativeWindowOpen` for main window
|
||||
- Remove `enableRemoteModule` from main window
|
||||
- Fix : Hot reloading issue caused by `liveReload` in webpack devServer
|
||||
- Added additional Webpack `devServer` configuration in `tools/forge/forge.config.js`
|
||||
- Upgraded outdated deps:
|
||||
- `@electron-forge` deps upgraded to `6.0.0-beta.60`
|
||||
- `@typescript-eslint` deps upgraded to `^4.30.0`
|
||||
- `@types/react` upgraded to `^17.0.19`
|
||||
- `electron` upgraded to `^14.0.0`
|
||||
- `eslint-plugin-import` upgraded to `^2.24.2`
|
||||
- `eslint-plugin-react` upgraded to `^7.25.1`
|
||||
- `typescript` upgraded to `^4.4.2`
|
||||
- `webpack` upgraded to `^5.51.1`
|
||||
|
||||
<br>
|
||||
|
||||
### v4.0.1
|
||||
|
||||
- Update file-loader configuration for `assets` files
|
||||
- Add packager configuration for app executable file details
|
||||
- Update `README` with similar useful projects
|
||||
|
||||
<br>
|
||||
|
||||
### v4.0.0
|
||||
|
||||
- Overhaul for Application default layout and styling.
|
||||
- Default window background color updated.
|
||||
- Default `minimal` stats output for main & renderer process via webpack.
|
||||
- Upgraded outdated deps :
|
||||
- `electron` upgraded to `^13.1.9`
|
||||
- `@electron-forge` packages upgraded to `6.0.0-beta.59`
|
||||
- `@typescript-eslint` packages upgraded to `^4.29.2`
|
||||
- `css-loader` upgraded to `^6.2.0`
|
||||
- `eslint` upgraded to `^7.32.0`
|
||||
- `fork-ts-checker-webpack-plugin` upgraded to `^6.3.2`
|
||||
- `less-loader` upgraded to `10.0.1`
|
||||
- `style-loader` upgraded to `^3.2.1`
|
||||
- `ts-loader` upgraded to `9.2.5`
|
||||
- `typescript` upgraded to `^4.3.5`
|
||||
- `webpack` upgraded to `^5.50.0`
|
||||
|
||||
<br>
|
||||
|
||||
### v3.1.0
|
||||
|
||||
- Electron core 🚀 upgraded to version 13.
|
||||
- Expose Webpack Ports settings in forge configuration.
|
||||
- Upgraded outdated packages :
|
||||
- `electron` upgraded to `^13.0.1`
|
||||
- `@typescript-eslint` packages upgraded to `^4.26.0`
|
||||
- `eslint` upgraded to `^7.27.0`
|
||||
- `css-loader` upgraded to `^5.2.6`
|
||||
- `ts-loader` upgraded to `8.3.0`
|
||||
- `typescript` upgraded to `^4.3.2`
|
||||
- `webpack` upgraded to `^5.38.1`
|
||||
- `fork-ts-checker-webpack-plugin` upgraded to `^6.2.10`
|
||||
|
||||
<br>
|
||||
|
||||
### v3.0.1
|
||||
|
||||
- Upgraded outdated packages
|
||||
- `electron'` upgraded to `^12.0.6`
|
||||
- `react` upgraded to `^17.0.2`
|
||||
- `react-dom` upgraded to `^17.0.2`
|
||||
- `css-loader` upgraded to `^5.2.4`
|
||||
- `eslint` upgraded to `^7.25.0`
|
||||
- `node-loader` upgraded to `2.0.0`
|
||||
- `ts-loader` upgraded to `8.2.0`
|
||||
- `typescript` upgraded to `^4.2.4`
|
||||
- `webpack` upgraded to `^5.36.2`
|
||||
|
||||
<br>
|
||||
|
||||
### v3.0.0
|
||||
|
||||
- Overhaul for Application component layout and styling.
|
||||
- Project Files structure updated.
|
||||
- Move static images to `assets` directory.
|
||||
- Remove `.prettierignore` file.
|
||||
- Use `.tsx` file extension for `preload` and `renderer` incase we need to use components.
|
||||
- Introduce new `assets` webpack alias.
|
||||
- Modify aliases usage for new project structure.
|
||||
- Upgraded outdated dependencies
|
||||
- `electron` upgraded to `12.0.1`
|
||||
- `css-loader` upgraded to `5.1.3`
|
||||
- `eslint` upgraded to `7.22.0`
|
||||
- `less` upgraded to `4.1.1`
|
||||
- `less-loader` upgraded to `7.3.0`
|
||||
- `ts-loader` upgraded to `8.0.18`
|
||||
- `typescript` upgraded to `4.2.3`
|
||||
- `webpack` upgraded to `5.27.1`
|
||||
|
||||
<br>
|
||||
|
||||
### v2.1.0
|
||||
|
||||
- New Year 2021 🎉🎊
|
||||
- Upgraded outdated dependencies
|
||||
- `electron` version upgraded to `11.1.1`
|
||||
- `react` version upgraded to `17.0.1`
|
||||
- `hot-loader` version upgraded to `17.0.1`
|
||||
- `webpack` version upgraded to `5.13.0`
|
||||
- `typescript` version upgraded to `4.1.3`
|
||||
- `ts-loader` version upgraded to `8.0.14`
|
||||
- `css-loader` version upgraded to `5.0.1`
|
||||
- `style-loader` version upgraded to `2.0.0`
|
||||
- `less` version upgraded to `4.1.0`
|
||||
|
||||
<br>
|
||||
|
||||
### v2.0.2
|
||||
|
||||
- Upgraded outdated dependencies
|
||||
- `electron` version upgraded to `10.x`
|
||||
- `typescript` version upgraded to `4.x`
|
||||
- `less-loader` version upgraded to `7.x`
|
||||
|
||||
<br>
|
||||
|
||||
### v2.0.1
|
||||
|
||||
- Upgraded outdated dependencies
|
||||
|
||||
<br>
|
||||
|
||||
### v2.0.0
|
||||
|
||||
- Added electron window background color
|
||||
- Devtools opening on startup is disabled
|
||||
- Added `preload` script usage (preload.ts) 👍
|
||||
- Moved webpack `aliases` to separate file
|
||||
- Added new style & color changes to boilerplate layout
|
||||
- Added prettier configuration files `.prettierrc` `.prettierignore`
|
||||
- `contextIsolation` is enabled by default
|
||||
- `nodeIntegration` `enableRemoteModule` `nodeIntegrationInWorker` `nodeIntegrationInSubFrames` are disabled default
|
||||
|
||||
<br>
|
||||
|
||||
### v1.0.0
|
||||
|
||||
- Upgrade package dependencies to latest
|
||||
- Add hot module replacement (live reload)
|
||||
- Add linting via ESLint
|
||||
- Custom webpack configuration
|
||||
- Custom forge configuration for package/bundle
|
||||
- Add aliases for project paths
|
||||
- Image loader to display images
|
||||
@ -0,0 +1,128 @@
|
||||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
We as members, contributors, and leaders pledge to make participation in our
|
||||
community a harassment-free experience for everyone, regardless of age, body
|
||||
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
||||
identity and expression, level of experience, education, socio-economic status,
|
||||
nationality, personal appearance, race, religion, or sexual identity
|
||||
and orientation.
|
||||
|
||||
We pledge to act and interact in ways that contribute to an open, welcoming,
|
||||
diverse, inclusive, and healthy community.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to a positive environment for our
|
||||
community include:
|
||||
|
||||
* Demonstrating empathy and kindness toward other people
|
||||
* Being respectful of differing opinions, viewpoints, and experiences
|
||||
* Giving and gracefully accepting constructive feedback
|
||||
* Accepting responsibility and apologizing to those affected by our mistakes,
|
||||
and learning from the experience
|
||||
* Focusing on what is best not just for us as individuals, but for the
|
||||
overall community
|
||||
|
||||
Examples of unacceptable behavior include:
|
||||
|
||||
* The use of sexualized language or imagery, and sexual attention or
|
||||
advances of any kind
|
||||
* Trolling, insulting or derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or email
|
||||
address, without their explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
|
||||
## Enforcement Responsibilities
|
||||
|
||||
Community leaders are responsible for clarifying and enforcing our standards of
|
||||
acceptable behavior and will take appropriate and fair corrective action in
|
||||
response to any behavior that they deem inappropriate, threatening, offensive,
|
||||
or harmful.
|
||||
|
||||
Community leaders have the right and responsibility to remove, edit, or reject
|
||||
comments, commits, code, wiki edits, issues, and other contributions that are
|
||||
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
||||
decisions when appropriate.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies within all community spaces, and also applies when
|
||||
an individual is officially representing the community in public spaces.
|
||||
Examples of representing our community include using an official e-mail address,
|
||||
posting via an official social media account, or acting as an appointed
|
||||
representative at an online or offline event.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported to the community leaders responsible for enforcement at
|
||||
Repository Discussions.
|
||||
All complaints will be reviewed and investigated promptly and fairly.
|
||||
|
||||
All community leaders are obligated to respect the privacy and security of the
|
||||
reporter of any incident.
|
||||
|
||||
## Enforcement Guidelines
|
||||
|
||||
Community leaders will follow these Community Impact Guidelines in determining
|
||||
the consequences for any action they deem in violation of this Code of Conduct:
|
||||
|
||||
### 1. Correction
|
||||
|
||||
**Community Impact**: Use of inappropriate language or other behavior deemed
|
||||
unprofessional or unwelcome in the community.
|
||||
|
||||
**Consequence**: A private, written warning from community leaders, providing
|
||||
clarity around the nature of the violation and an explanation of why the
|
||||
behavior was inappropriate. A public apology may be requested.
|
||||
|
||||
### 2. Warning
|
||||
|
||||
**Community Impact**: A violation through a single incident or series
|
||||
of actions.
|
||||
|
||||
**Consequence**: A warning with consequences for continued behavior. No
|
||||
interaction with the people involved, including unsolicited interaction with
|
||||
those enforcing the Code of Conduct, for a specified period of time. This
|
||||
includes avoiding interactions in community spaces as well as external channels
|
||||
like social media. Violating these terms may lead to a temporary or
|
||||
permanent ban.
|
||||
|
||||
### 3. Temporary Ban
|
||||
|
||||
**Community Impact**: A serious violation of community standards, including
|
||||
sustained inappropriate behavior.
|
||||
|
||||
**Consequence**: A temporary ban from any sort of interaction or public
|
||||
communication with the community for a specified period of time. No public or
|
||||
private interaction with the people involved, including unsolicited interaction
|
||||
with those enforcing the Code of Conduct, is allowed during this period.
|
||||
Violating these terms may lead to a permanent ban.
|
||||
|
||||
### 4. Permanent Ban
|
||||
|
||||
**Community Impact**: Demonstrating a pattern of violation of community
|
||||
standards, including sustained inappropriate behavior, harassment of an
|
||||
individual, or aggression toward or disparagement of classes of individuals.
|
||||
|
||||
**Consequence**: A permanent ban from any sort of public interaction within
|
||||
the community.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
||||
version 2.0, available at
|
||||
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
||||
|
||||
Community Impact Guidelines were inspired by [Mozilla's code of conduct
|
||||
enforcement ladder](https://github.com/mozilla/diversity).
|
||||
|
||||
[homepage]: https://www.contributor-covenant.org
|
||||
|
||||
For answers to common questions about this code of conduct, see the FAQ at
|
||||
https://www.contributor-covenant.org/faq. Translations are available at
|
||||
https://www.contributor-covenant.org/translations.
|
||||
@ -0,0 +1,19 @@
|
||||
# Contributing to ERWT
|
||||
|
||||
Thank you for investing your time in contributing to our project!
|
||||
|
||||
Read our [Code of Conduct](./CODE_OF_CONDUCT.md) to keep our community approachable and respectable.
|
||||
|
||||
<br>
|
||||
|
||||
## How to Contribute?
|
||||
|
||||
You can contribute to our project by providing `features/bugfixes/improvements` related Pull Requests.
|
||||
<br>
|
||||
Just make sure to test all the changes you provide before submission anything into this project.
|
||||
|
||||
<br>
|
||||
|
||||
## Having a question about this project?
|
||||
|
||||
Feel free to use [Discussions](https://github.com/codesbiome/electron-react-webpack-typescript-2022/discussions) to ask any questions related to this project.
|
||||
21
packages/osr-code-bot/kbot-extensions/gui/kbot/LICENSE
Normal file
@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2022 Codesbiome
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
177
packages/osr-code-bot/kbot-extensions/gui/kbot/README.md
Normal file
@ -0,0 +1,177 @@
|
||||
# Electron React Webpack Typescript (Custom Titlebar)
|
||||
|
||||
A prebuilt project for creating desktop apps using Electron, React, Webpack & Typescript with hot-reload, easy to use custom import aliases & executable builds for distribution.
|
||||
|
||||
<br>
|
||||
<img src="assets/images/anim_v8.gif" />
|
||||
<br>
|
||||
|
||||
Special thanks to [@guasam](https://github.com/guasam) for development of Custom Window, Titlebar, UI/UX etc.
|
||||
|
||||
<br>
|
||||
|
||||
## Core Features
|
||||
|
||||
- 🌟 Electron
|
||||
- 🌀 TypeScript
|
||||
- ⚛️ React
|
||||
- 🥗 SASS/SCSS Loader
|
||||
- 🎨 CSS Loader
|
||||
- 📸 Image Loader
|
||||
- 🆎 Font Loader
|
||||
- 🧹 ESLint
|
||||
- 📦 Electron Forge
|
||||
- 📐 Custom Window Frame
|
||||
- 📐 Custom Window Titlebar
|
||||
- 📐 Custom Window Menubar
|
||||
- 🔱 Webpack & Configuration
|
||||
- 🧩 Aliases for Project Paths
|
||||
- 🗡️ Native (node) Modules Support
|
||||
- 🔥 React Fast Refresh + Webpack HMR
|
||||
- 🌞 Dark Mode + Light Mode (Theme)
|
||||
- 🎁 Package Bundling (Distribution / Release)
|
||||
|
||||
<br>
|
||||
|
||||
## Custom Electron Window Titlebar & Menus
|
||||
|
||||
This project includes [electron-window](https://github.com/guasam/electron-window) as core of custom window components and modules.
|
||||
|
||||
**Following are the list of features it provides :**
|
||||
|
||||
- Custom Titlebar for Electron Window.
|
||||
- Easily changable platform specific controls for max/min/close buttons using `windows` or `mac` value for `platform` property with `<WindowFrame>` in renderer.
|
||||
- Titlebar menus can show/hide by pressing `alt` or `option` key.
|
||||
- Window frame `title` prop displays in titlebar center when menus are toggeled off.
|
||||
- Menu entries can be customized in `src/main/window/titlebarMenus.ts` file.
|
||||
- Menu items and windows controls UI or colors can be customized easily by modifying the `src/renderer/window` components & styles.
|
||||
|
||||
<br>
|
||||
|
||||
### Custom Aliases for Paths
|
||||
|
||||
We can use predefined aliases for `import` paths already used in this project. Following are the details:
|
||||
|
||||
| Alias | Target Path |
|
||||
| ------------- | -------------------------- |
|
||||
| `@assets` | `/assets` |
|
||||
| `@main` | `/src/main` |
|
||||
| `@renderer` | `/src/renderer` |
|
||||
| `@common` | `/src/common` |
|
||||
| `@src` | `/src` |
|
||||
| `@styles` | `/src/renderer/styles` |
|
||||
| `@components` | `/src/renderer/components` |
|
||||
|
||||
|
||||
<br>
|
||||
|
||||
### Want to use Vite instead of Webpack bundler?
|
||||
|
||||
Introducing the [ElectroVite](https://github.com/guasam/electrovite-react) project with a brief description below.
|
||||
|
||||
<br>
|
||||
|
||||
## Installation
|
||||
|
||||

|
||||
|
||||
Main version of this project contains files structure in separate context for `main` and `renderer`, with custom electron window, titlebar etc.
|
||||
|
||||
```bash
|
||||
git clone https://github.com/codesbiome/electron-react-webpack-typescript-2024
|
||||
```
|
||||
|
||||
<br>
|
||||
<div align="center">
|
||||
<b>OR</b>
|
||||
</div>
|
||||
<br>
|
||||
|
||||

|
||||
|
||||
Minimal version of ERWT contains very simple project files structure, no custom window, no custom titlebar & menus.
|
||||
|
||||
```bash
|
||||
git clone -b minimal https://github.com/codesbiome/electron-react-webpack-typescript-2024
|
||||
```
|
||||
|
||||
<br>
|
||||
|
||||
Install dependencies using [pnpm](https://pnpm.io/) or [yarn](https://www.npmjs.com/package/yarn) or [npm](https://www.npmjs.com/) :
|
||||
|
||||
```bash
|
||||
# using pnpm
|
||||
pnpm install
|
||||
|
||||
# or using yarn
|
||||
yarn install
|
||||
|
||||
# or using npm
|
||||
npm install
|
||||
```
|
||||
|
||||
<br />
|
||||
|
||||
## Start : Development
|
||||
|
||||
To develop and run your application, you need to run following command.
|
||||
<br />
|
||||
Start electron application for development :
|
||||
|
||||
```bash
|
||||
yarn start
|
||||
```
|
||||
|
||||
<br />
|
||||
|
||||
## Lint : Development
|
||||
|
||||
To lint application source code using ESLint via this command :
|
||||
|
||||
```bash
|
||||
yarn lint
|
||||
```
|
||||
|
||||
<br />
|
||||
|
||||
## Package : Production
|
||||
|
||||
Customize and package your Electron app with OS-specific bundles (.app, .exe etc)
|
||||
|
||||
```bash
|
||||
yarn package
|
||||
```
|
||||
|
||||
<br />
|
||||
|
||||
## Make : Production
|
||||
|
||||
Making is a way of taking your packaged application and making platform specific distributables like DMG, EXE, or Flatpak files (amongst others).
|
||||
|
||||
```bash
|
||||
yarn make
|
||||
```
|
||||
|
||||
<br />
|
||||
|
||||
## Publish : Production
|
||||
|
||||
Publishing is a way of taking the artifacts generated by the `make` command and sending them to a service somewhere for you to distribute or use as updates. (This could be your update server or an S3 bucket)
|
||||
|
||||
```bash
|
||||
yarn publish
|
||||
```
|
||||
|
||||
<br />
|
||||
|
||||
## Packager & Makers Configuration
|
||||
|
||||
This provides an easy way of configuring your packaged application and making platform specific distributables like DMG, EXE, or Flatpak files.
|
||||
|
||||
This configurations file is available in :
|
||||
|
||||
```bash
|
||||
tools/forge/forge.config.js
|
||||
```
|
||||
|
||||
For further information, you can visit [Electron Forge Configuration](https://www.electronforge.io/configuration)
|
||||
@ -0,0 +1,3 @@
|
||||
# Attribution
|
||||
|
||||
<a href="https://www.flaticon.com/free-icons/license" title="license icons">Thanks to Flaticon</a>
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 8.1 KiB |
|
After Width: | Height: | Size: 3.4 KiB |
|
After Width: | Height: | Size: 1020 B |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 3.1 KiB |
|
After Width: | Height: | Size: 266 KiB |
|
After Width: | Height: | Size: 4.2 KiB |
|
After Width: | Height: | Size: 3.4 KiB |
@ -0,0 +1,18 @@
|
||||
{
|
||||
"env": {
|
||||
"browser": true,
|
||||
"es6": true,
|
||||
"node": true
|
||||
},
|
||||
"extends": ["eslint:recommended", "plugin:react/recommended"],
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"settings": {
|
||||
"react": {
|
||||
"version": "latest"
|
||||
}
|
||||
},
|
||||
"rules": {
|
||||
"react/prop-types": "off",
|
||||
"@typescript-eslint/no-var-requires": "off"
|
||||
}
|
||||
}
|
||||
90
packages/osr-code-bot/kbot-extensions/gui/kbot/package.json
Normal file
@ -0,0 +1,90 @@
|
||||
{
|
||||
"name": "erwt",
|
||||
"productName": "ERWT",
|
||||
"version": "8.1.0",
|
||||
"description": "Robust project for developing Desktop Application with Electron, React, Webpack & TypeScript.",
|
||||
"main": ".webpack/main",
|
||||
"scripts": {
|
||||
"start": "cross-env NODE_ENV=development electron-forge start",
|
||||
"package": "electron-forge package",
|
||||
"make": "electron-forge make",
|
||||
"publish": "electron-forge publish",
|
||||
"lint": "eslint src/ --ext .ts,.js,.tsx,.jsx"
|
||||
},
|
||||
"keywords": [
|
||||
"electron boilerplate",
|
||||
"minimal",
|
||||
"electron-webpack",
|
||||
"electron-react",
|
||||
"electron-typescript",
|
||||
"hmr",
|
||||
"boilerplate",
|
||||
"2024",
|
||||
"ERWT"
|
||||
],
|
||||
"author": {
|
||||
"name": "codesbiome",
|
||||
"url": "https://github.com/codesbiome"
|
||||
},
|
||||
"contributors": [
|
||||
{
|
||||
"name": "guasam",
|
||||
"url": "https://github.com/guasam"
|
||||
}
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/codesbiome/electron-react-webpack-typescript-2024"
|
||||
},
|
||||
"license": "MIT",
|
||||
"config": {
|
||||
"forge": "./tools/forge/forge.config.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@electron-forge/cli": "7.4.0",
|
||||
"@electron-forge/maker-deb": "7.4.0",
|
||||
"@electron-forge/maker-rpm": "7.4.0",
|
||||
"@electron-forge/maker-squirrel": "7.4.0",
|
||||
"@electron-forge/maker-zip": "7.4.0",
|
||||
"@electron-forge/plugin-webpack": "7.4.0",
|
||||
"@marshallofsound/webpack-asset-relocator-loader": "^0.5.0",
|
||||
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.15",
|
||||
"@types/node": "^20.14.11",
|
||||
"@types/react": "^18.3.3",
|
||||
"@types/react-dom": "^18.3.0",
|
||||
"@types/webpack-env": "^1.18.5",
|
||||
"@typescript-eslint/eslint-plugin": "^7.16.1",
|
||||
"@typescript-eslint/parser": "^7.16.1",
|
||||
"@vercel/webpack-asset-relocator-loader": "1.7.3",
|
||||
"classnames": "^2.5.1",
|
||||
"cross-env": "^7.0.3",
|
||||
"css-loader": "^7.1.2",
|
||||
"electron": "^31.2.1",
|
||||
"eslint": "^9.7.0",
|
||||
"eslint-import-resolver-alias": "^1.1.2",
|
||||
"eslint-plugin-import": "^2.29.1",
|
||||
"eslint-plugin-react": "^7.34.4",
|
||||
"file-loader": "^6.2.0",
|
||||
"fork-ts-checker-webpack-plugin": "^9.0.2",
|
||||
"json-loader": "^0.5.7",
|
||||
"node-loader": "^2.0.0",
|
||||
"react-refresh": "^0.14.2",
|
||||
"sass": "^1.77.8",
|
||||
"sass-loader": "^14.2.1",
|
||||
"style-loader": "^4.0.0",
|
||||
"ts-loader": "9.5.1",
|
||||
"typescript": "^5.5.3",
|
||||
"webpack": "^5.93.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@plastichub/fs": "^0.13.41",
|
||||
"@plastichub/osr-commons": "^0.5.2",
|
||||
"@rjsf/core": "^5.24.1",
|
||||
"@rjsf/mui": "^5.24.1",
|
||||
"@rjsf/utils": "^5.24.1",
|
||||
"@rjsf/validator-ajv8": "^5.24.1",
|
||||
"electron-squirrel-startup": "^1.0.1",
|
||||
"react": "^18.3.1",
|
||||
"react-dom": "^18.3.1"
|
||||
}
|
||||
}
|
||||
9172
packages/osr-code-bot/kbot-extensions/gui/kbot/pnpm-lock.yaml
Normal file
@ -0,0 +1,48 @@
|
||||
import { app, BrowserWindow } from 'electron';
|
||||
import { createAppWindow } from './appWindow';
|
||||
|
||||
/** Handle creating/removing shortcuts on Windows when installing/uninstalling. */
|
||||
if (require('electron-squirrel-startup')) {
|
||||
app.quit();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method will be called when Electron has finished
|
||||
* initialization and is ready to create browser windows.
|
||||
* Some APIs can only be used after this event occurs.
|
||||
*/
|
||||
app.on('ready', createAppWindow);
|
||||
|
||||
/**
|
||||
* Emitted when the application is activated. Various actions can
|
||||
* trigger this event, such as launching the application for the first time,
|
||||
* attempting to re-launch the application when it's already running,
|
||||
* or clicking on the application's dock or taskbar icon.
|
||||
*/
|
||||
app.on('activate', () => {
|
||||
/**
|
||||
* On OS X it's common to re-create a window in the app when the
|
||||
* dock icon is clicked and there are no other windows open.
|
||||
*/
|
||||
if (BrowserWindow.getAllWindows().length === 0) {
|
||||
createAppWindow();
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Emitted when all windows have been closed.
|
||||
*/
|
||||
app.on('window-all-closed', () => {
|
||||
/**
|
||||
* On OS X it is common for applications and their menu bar
|
||||
* to stay active until the user quits explicitly with Cmd + Q
|
||||
*/
|
||||
if (process.platform !== 'darwin') {
|
||||
app.quit();
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* In this file you can include the rest of your app's specific main process code.
|
||||
* You can also put them in separate files and import them here.
|
||||
*/
|
||||
@ -0,0 +1,63 @@
|
||||
import { app, BrowserWindow } from 'electron';
|
||||
import path from 'path';
|
||||
import { registerTitlebarIpc } from '@main/window/titlebarIpc';
|
||||
|
||||
// Electron Forge automatically creates these entry points
|
||||
declare const APP_WINDOW_WEBPACK_ENTRY: string;
|
||||
declare const APP_WINDOW_PRELOAD_WEBPACK_ENTRY: string;
|
||||
|
||||
let appWindow: BrowserWindow;
|
||||
|
||||
/**
|
||||
* Create Application Window
|
||||
* @returns {BrowserWindow} Application Window Instance
|
||||
*/
|
||||
export function createAppWindow(): BrowserWindow {
|
||||
// Create new window instance
|
||||
appWindow = new BrowserWindow({
|
||||
width: 800,
|
||||
height: 600,
|
||||
backgroundColor: '#202020',
|
||||
show: false,
|
||||
autoHideMenuBar: true,
|
||||
frame: false,
|
||||
titleBarStyle: 'hidden',
|
||||
icon: path.resolve('assets/images/appIcon.ico'),
|
||||
webPreferences: {
|
||||
nodeIntegration: false,
|
||||
contextIsolation: true,
|
||||
nodeIntegrationInWorker: false,
|
||||
nodeIntegrationInSubFrames: false,
|
||||
preload: APP_WINDOW_PRELOAD_WEBPACK_ENTRY,
|
||||
sandbox: false,
|
||||
},
|
||||
});
|
||||
|
||||
// Load the index.html of the app window.
|
||||
appWindow.loadURL(APP_WINDOW_WEBPACK_ENTRY);
|
||||
|
||||
// Show window when its ready to
|
||||
appWindow.on('ready-to-show', () => appWindow.show());
|
||||
|
||||
// Register Inter Process Communication for main process
|
||||
registerMainIPC();
|
||||
|
||||
// Close all windows when main window is closed
|
||||
appWindow.on('close', () => {
|
||||
appWindow = null;
|
||||
app.quit();
|
||||
});
|
||||
|
||||
return appWindow;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register Inter Process Communication
|
||||
*/
|
||||
function registerMainIPC() {
|
||||
/**
|
||||
* Here you can assign IPC related codes for the application window
|
||||
* to Communicate asynchronously from the main process to renderer processes.
|
||||
*/
|
||||
registerTitlebarIpc(appWindow);
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
Copyright (c) 2021-2022 Guasam
|
||||
|
||||
This software is provided "as-is", without any express or implied warranty. In no event
|
||||
will the authors be held liable for any damages arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose, including commercial
|
||||
applications, and to alter it and redistribute it freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not claim that you
|
||||
wrote the original software. If you use this software in a product, an acknowledgment
|
||||
in the product documentation would be appreciated but is not required.
|
||||
|
||||
2. Altered source versions must be plainly marked as such, and must not be misrepresented
|
||||
as being the original software.
|
||||
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
@ -0,0 +1,74 @@
|
||||
/**
|
||||
* Copyright (c) 2021, Guasam
|
||||
*
|
||||
* This software is provided "as-is", without any express or implied warranty. In no event
|
||||
* will the authors be held liable for any damages arising from the use of this software.
|
||||
* Read the LICENSE file for more details.
|
||||
*
|
||||
* @author : guasam
|
||||
* @project : Electron Window
|
||||
* @package : Titlebar IPC (Renderer Process)
|
||||
*/
|
||||
|
||||
import { ipcRenderer } from 'electron';
|
||||
|
||||
const titlebarContext = {
|
||||
exit() {
|
||||
ipcRenderer.invoke('window-close');
|
||||
},
|
||||
undo() {
|
||||
ipcRenderer.invoke('web-undo');
|
||||
},
|
||||
redo() {
|
||||
ipcRenderer.invoke('web-redo');
|
||||
},
|
||||
cut() {
|
||||
ipcRenderer.invoke('web-cut');
|
||||
},
|
||||
copy() {
|
||||
ipcRenderer.invoke('web-copy');
|
||||
},
|
||||
paste() {
|
||||
ipcRenderer.invoke('web-paste');
|
||||
},
|
||||
delete() {
|
||||
ipcRenderer.invoke('web-delete');
|
||||
},
|
||||
select_all() {
|
||||
ipcRenderer.invoke('web-select-all');
|
||||
},
|
||||
reload() {
|
||||
ipcRenderer.invoke('web-reload');
|
||||
},
|
||||
force_reload() {
|
||||
ipcRenderer.invoke('web-force-reload');
|
||||
},
|
||||
toggle_devtools() {
|
||||
ipcRenderer.invoke('web-toggle-devtools');
|
||||
},
|
||||
actual_size() {
|
||||
ipcRenderer.invoke('web-actual-size');
|
||||
},
|
||||
zoom_in() {
|
||||
ipcRenderer.invoke('web-zoom-in');
|
||||
},
|
||||
zoom_out() {
|
||||
ipcRenderer.invoke('web-zoom-out');
|
||||
},
|
||||
toggle_fullscreen() {
|
||||
ipcRenderer.invoke('web-toggle-fullscreen');
|
||||
},
|
||||
minimize() {
|
||||
ipcRenderer.invoke('window-minimize');
|
||||
},
|
||||
toggle_maximize() {
|
||||
ipcRenderer.invoke('window-toggle-maximize');
|
||||
},
|
||||
open_url(url: string) {
|
||||
ipcRenderer.invoke('open-url', url);
|
||||
},
|
||||
};
|
||||
|
||||
export type TitlebarContextApi = typeof titlebarContext;
|
||||
|
||||
export default titlebarContext;
|
||||
@ -0,0 +1,17 @@
|
||||
/**
|
||||
* Copyright (c) 2021, Guasam
|
||||
*
|
||||
* This software is provided "as-is", without any express or implied warranty. In no event
|
||||
* will the authors be held liable for any damages arising from the use of this software.
|
||||
* Read the LICENSE file for more details.
|
||||
*
|
||||
* @author : guasam
|
||||
* @project : Electron Window
|
||||
* @package : Titlebar Context API
|
||||
*/
|
||||
|
||||
import { TitlebarContextApi } from './titlebarContext';
|
||||
|
||||
const context: TitlebarContextApi = (window as any).electron_window?.titlebar;
|
||||
|
||||
export default context;
|
||||
@ -0,0 +1,95 @@
|
||||
/**
|
||||
* Copyright (c) 2021, Guasam
|
||||
*
|
||||
* This software is provided "as-is", without any express or implied warranty. In no event
|
||||
* will the authors be held liable for any damages arising from the use of this software.
|
||||
* Read the LICENSE file for more details.
|
||||
*
|
||||
* @author : guasam
|
||||
* @project : Electron Window
|
||||
* @package : Titlebar IPC (Main Process)
|
||||
*/
|
||||
|
||||
import { BrowserWindow, ipcMain, shell } from 'electron';
|
||||
|
||||
export const registerTitlebarIpc = (mainWindow: BrowserWindow) => {
|
||||
ipcMain.handle('window-minimize', () => {
|
||||
mainWindow.minimize();
|
||||
});
|
||||
|
||||
ipcMain.handle('window-maximize', () => {
|
||||
mainWindow.maximize();
|
||||
});
|
||||
|
||||
ipcMain.handle('window-toggle-maximize', () => {
|
||||
if (mainWindow.isMaximized()) {
|
||||
mainWindow.unmaximize();
|
||||
} else {
|
||||
mainWindow.maximize();
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle('window-close', () => {
|
||||
mainWindow.close();
|
||||
});
|
||||
|
||||
ipcMain.handle('web-undo', () => {
|
||||
mainWindow.webContents.undo();
|
||||
});
|
||||
|
||||
ipcMain.handle('web-redo', () => {
|
||||
mainWindow.webContents.redo();
|
||||
});
|
||||
|
||||
ipcMain.handle('web-cut', () => {
|
||||
mainWindow.webContents.cut();
|
||||
});
|
||||
|
||||
ipcMain.handle('web-copy', () => {
|
||||
mainWindow.webContents.copy();
|
||||
});
|
||||
|
||||
ipcMain.handle('web-paste', () => {
|
||||
mainWindow.webContents.paste();
|
||||
});
|
||||
|
||||
ipcMain.handle('web-delete', () => {
|
||||
mainWindow.webContents.delete();
|
||||
});
|
||||
|
||||
ipcMain.handle('web-select-all', () => {
|
||||
mainWindow.webContents.selectAll();
|
||||
});
|
||||
|
||||
ipcMain.handle('web-reload', () => {
|
||||
mainWindow.webContents.reload();
|
||||
});
|
||||
|
||||
ipcMain.handle('web-force-reload', () => {
|
||||
mainWindow.webContents.reloadIgnoringCache();
|
||||
});
|
||||
|
||||
ipcMain.handle('web-toggle-devtools', () => {
|
||||
mainWindow.webContents.toggleDevTools();
|
||||
});
|
||||
|
||||
ipcMain.handle('web-actual-size', () => {
|
||||
mainWindow.webContents.setZoomLevel(0);
|
||||
});
|
||||
|
||||
ipcMain.handle('web-zoom-in', () => {
|
||||
mainWindow.webContents.setZoomLevel(mainWindow.webContents.zoomLevel + 0.5);
|
||||
});
|
||||
|
||||
ipcMain.handle('web-zoom-out', () => {
|
||||
mainWindow.webContents.setZoomLevel(mainWindow.webContents.zoomLevel - 0.5);
|
||||
});
|
||||
|
||||
ipcMain.handle('web-toggle-fullscreen', () => {
|
||||
mainWindow.setFullScreen(!mainWindow.fullScreen);
|
||||
});
|
||||
|
||||
ipcMain.handle('open-url', (e, url) => {
|
||||
shell.openExternal(url);
|
||||
});
|
||||
};
|
||||
@ -0,0 +1,160 @@
|
||||
/**
|
||||
* Copyright (c) 2021, Guasam
|
||||
*
|
||||
* This software is provided "as-is", without any express or implied warranty. In no event
|
||||
* will the authors be held liable for any damages arising from the use of this software.
|
||||
* Read the LICENSE file for more details.
|
||||
*
|
||||
* @author : guasam
|
||||
* @project : Electron Window
|
||||
* @package : Titlebar Menu Items
|
||||
*/
|
||||
|
||||
export type TitlebarMenuItem = {
|
||||
name: string;
|
||||
action?: string;
|
||||
shortcut?: string;
|
||||
value?: string | number;
|
||||
items?: TitlebarMenuItem[];
|
||||
};
|
||||
|
||||
export type TitlebarMenu = {
|
||||
name: string;
|
||||
items: TitlebarMenuItem[];
|
||||
};
|
||||
|
||||
const titlebarMenus: TitlebarMenu[] = [
|
||||
{
|
||||
name: 'File',
|
||||
items: [
|
||||
{
|
||||
name: 'Exit',
|
||||
action: 'exit',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'Edit',
|
||||
items: [
|
||||
{
|
||||
name: 'Undo',
|
||||
action: 'undo',
|
||||
shortcut: 'Ctrl+Z',
|
||||
},
|
||||
{
|
||||
name: 'Redo',
|
||||
action: 'redo',
|
||||
shortcut: 'Ctrl+Y',
|
||||
},
|
||||
{
|
||||
name: '__',
|
||||
},
|
||||
{
|
||||
name: 'Cut',
|
||||
action: 'cut',
|
||||
shortcut: 'Ctrl+X',
|
||||
},
|
||||
{
|
||||
name: 'Copy',
|
||||
action: 'copy',
|
||||
shortcut: 'Ctrl+C',
|
||||
},
|
||||
{
|
||||
name: 'Paste',
|
||||
action: 'paste',
|
||||
shortcut: 'Ctrl+V',
|
||||
},
|
||||
{
|
||||
name: 'Delete',
|
||||
action: 'delete',
|
||||
},
|
||||
{
|
||||
name: '__',
|
||||
},
|
||||
{
|
||||
name: 'Select All',
|
||||
action: 'select_all',
|
||||
shortcut: 'Ctrl+A',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'View',
|
||||
items: [
|
||||
{
|
||||
name: 'Reload',
|
||||
action: 'reload',
|
||||
shortcut: 'Ctrl+R',
|
||||
},
|
||||
{
|
||||
name: 'Force Reload',
|
||||
action: 'force_reload',
|
||||
shortcut: 'Ctrl+Shift+R',
|
||||
},
|
||||
{
|
||||
name: 'Toogle Developer Tools',
|
||||
action: 'toggle_devtools',
|
||||
shortcut: 'Ctrl+Shift+I',
|
||||
},
|
||||
{
|
||||
name: '__',
|
||||
},
|
||||
{
|
||||
name: 'Actual Size',
|
||||
action: 'actual_size',
|
||||
shortcut: 'Ctrl+0',
|
||||
},
|
||||
{
|
||||
name: 'Zoom In',
|
||||
action: 'zoom_in',
|
||||
shortcut: 'Ctrl++',
|
||||
},
|
||||
{
|
||||
name: 'Zoom Out',
|
||||
action: 'zoom_out',
|
||||
shortcut: 'Ctrl+-',
|
||||
},
|
||||
{
|
||||
name: '__',
|
||||
},
|
||||
{
|
||||
name: 'Toggle Fullscreen',
|
||||
action: 'toggle_fullscreen',
|
||||
shortcut: 'F11',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'Window',
|
||||
items: [
|
||||
{
|
||||
name: 'Maximize',
|
||||
action: 'toggle_maximize',
|
||||
shortcut: 'Toggle'
|
||||
},
|
||||
{
|
||||
name: 'Minimize',
|
||||
action: 'minimize',
|
||||
shortcut: 'Ctrl+M',
|
||||
},
|
||||
{
|
||||
name: 'Close',
|
||||
action: 'exit',
|
||||
shortcut: 'Ctrl+W',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'Credits',
|
||||
items: [
|
||||
{
|
||||
name: 'Guasam',
|
||||
action: 'open_url',
|
||||
value: 'https://github.com/guasam',
|
||||
shortcut: '@guasam',
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
export default titlebarMenus;
|
||||
@ -0,0 +1,6 @@
|
||||
import { contextBridge } from 'electron';
|
||||
import titlebarContext from './titlebarContext';
|
||||
|
||||
contextBridge.exposeInMainWorld('electron_window', {
|
||||
titlebar: titlebarContext,
|
||||
});
|
||||
@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>ERWT Boilerplate</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
</body>
|
||||
</html>
|
||||
@ -0,0 +1,35 @@
|
||||
import '@main/window/windowPreload';
|
||||
|
||||
// Say something
|
||||
console.log('[ERWT] : Preload execution started');
|
||||
|
||||
// Get versions
|
||||
window.addEventListener('DOMContentLoaded', () => {
|
||||
const app = document.getElementById('app');
|
||||
const { env } = process;
|
||||
const versions: Record<string, unknown> = {};
|
||||
|
||||
// ERWT Package version
|
||||
versions['erwt'] = env['npm_package_version'];
|
||||
versions['license'] = env['npm_package_license'];
|
||||
|
||||
// Process versions
|
||||
for (const type of ['chrome', 'node', 'electron']) {
|
||||
versions[type] = process.versions[type].replace('+', '');
|
||||
}
|
||||
|
||||
// NPM deps versions
|
||||
for (const type of ['react']) {
|
||||
const v = env['npm_package_dependencies_' + type];
|
||||
if (v) versions[type] = v.replace('^', '');
|
||||
}
|
||||
|
||||
// NPM @dev deps versions
|
||||
for (const type of ['webpack', 'typescript']) {
|
||||
const v = env['npm_package_devDependencies_' + type];
|
||||
if (v) versions[type] = v.replace('^', '');
|
||||
}
|
||||
|
||||
// Set versions to app data
|
||||
app.setAttribute('data-versions', JSON.stringify(versions));
|
||||
});
|
||||
@ -0,0 +1,17 @@
|
||||
import React from 'react';
|
||||
import { createRoot } from 'react-dom/client';
|
||||
import WindowFrame from '@renderer/window/WindowFrame';
|
||||
import Application from '@components/Application';
|
||||
|
||||
// Say something
|
||||
console.log('[ERWT] : Renderer execution started');
|
||||
|
||||
// Application to Render
|
||||
const app = (
|
||||
<WindowFrame title='ERWT Boilerplate' platform='windows'>
|
||||
<Application />
|
||||
</WindowFrame>
|
||||
);
|
||||
|
||||
// Render application in DOM
|
||||
createRoot(document.getElementById('app')).render(app);
|
||||
@ -0,0 +1,19 @@
|
||||
import chrome from '@assets/icons/chrome.png';
|
||||
import react from '@assets/icons/react.png';
|
||||
import typescript from '@assets/icons/typescript.png';
|
||||
import erwt from '@assets/icons/erwt.png';
|
||||
import electron from '@assets/icons/electron.png';
|
||||
import nodejs from '@assets/icons/nodejs.png';
|
||||
import webpack from '@assets/icons/webpack.png';
|
||||
import license from '@assets/icons/license.png';
|
||||
|
||||
export default {
|
||||
chrome,
|
||||
react,
|
||||
typescript,
|
||||
erwt,
|
||||
electron,
|
||||
nodejs,
|
||||
webpack,
|
||||
license,
|
||||
};
|
||||
@ -0,0 +1,358 @@
|
||||
/**
|
||||
* Licensed under the MIT License. See LICENSE file in the project root for license information.
|
||||
* Copyright (c) 2022 Codesbiome, guasam
|
||||
*
|
||||
* @author : guasam
|
||||
* @project : ERWT Boilerplate
|
||||
* @package : Application Sass Stylesheet
|
||||
*/
|
||||
|
||||
@import './dark_theme.scss';
|
||||
@import './light_theme.scss';
|
||||
|
||||
/**
|
||||
*==========================================================================
|
||||
* Application Specific Stylesheet
|
||||
*==========================================================================
|
||||
*
|
||||
* Here we use the codes to apply application specific style
|
||||
*/
|
||||
|
||||
::selection {
|
||||
background: var(--selection-bgcolor);
|
||||
color: var(--selection-color);
|
||||
}
|
||||
|
||||
::-webkit-scrollbar {
|
||||
width: var(--scroll-width);
|
||||
|
||||
&-track {
|
||||
background: var(--scroll-track-bgcolor);
|
||||
}
|
||||
|
||||
&-thumb {
|
||||
background: var(--scroll-thumb-bgcolor);
|
||||
}
|
||||
|
||||
&-thumb:hover {
|
||||
background: var(--scroll-thumb-hover-bgcolor);
|
||||
}
|
||||
}
|
||||
|
||||
html,
|
||||
body,
|
||||
#app {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
font-size: var(--app-font-size);
|
||||
font-family: var(--app-font-family);
|
||||
color: var(--app-color);
|
||||
background: var(--app-bgcolor);
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
/* Grid texture */
|
||||
body {
|
||||
background-size: 32px 32px;
|
||||
background-image:
|
||||
linear-gradient(to right, #7070700d 1px, transparent 1px),
|
||||
linear-gradient(to bottom, #7070700d 1px, transparent 1px);
|
||||
}
|
||||
|
||||
h1 {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#app {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
box-sizing: border-box;
|
||||
user-select: none;
|
||||
|
||||
&.has-border {
|
||||
border: var(--app-border-color);
|
||||
}
|
||||
}
|
||||
|
||||
button {
|
||||
background: var(--button-bgcolor);
|
||||
color: var(--button-color);
|
||||
font-weight: normal;
|
||||
text-shadow: 0px 1px var(--button-shadow-color);
|
||||
font-family: var(--app-font-family);
|
||||
border: var(--button-border);
|
||||
padding: 0.5rem 1rem;
|
||||
border-radius: 6px;
|
||||
font-size: 0.875rem;
|
||||
cursor: pointer;
|
||||
display: inline-flex;
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
outline: none;
|
||||
min-width: 140px;
|
||||
|
||||
&:hover {
|
||||
background: var(--button-hover-bgcolor);
|
||||
}
|
||||
|
||||
&:active {
|
||||
background: var(--button-active-bgcolor);
|
||||
}
|
||||
|
||||
&>span {
|
||||
color: var(--button-badge-color);
|
||||
background-color: var(--button-badge-bgcolor);
|
||||
font-size: 12px;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
border-radius: 50%;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
display: none;
|
||||
}
|
||||
|
||||
img {
|
||||
width: 22px;
|
||||
opacity: 0.8;
|
||||
}
|
||||
}
|
||||
|
||||
.rotate {
|
||||
animation: rotate 4.5s linear infinite;
|
||||
}
|
||||
|
||||
@keyframes rotate {
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
.main-heading {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-bottom: 2rem;
|
||||
|
||||
img {
|
||||
margin-right: 1rem;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 1.5rem;
|
||||
font-weight: 400;
|
||||
color: var(--erwt-heading-color);
|
||||
line-height: 1;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
}
|
||||
|
||||
.hidden {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.center {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.main-teaser {
|
||||
position: relative;
|
||||
display: flex;
|
||||
line-height: 25px;
|
||||
font-size: 14px;
|
||||
color: #d8d8d894;
|
||||
width: 60%;
|
||||
margin: 0 auto;
|
||||
margin-bottom: 3rem;
|
||||
justify-content: center;
|
||||
padding: 1rem;
|
||||
padding-right: 1rem;
|
||||
border-radius: 0 0 8px 8px;
|
||||
box-shadow: 0 8px 10px 0px rgba(0, 0, 0, 0.01);
|
||||
}
|
||||
|
||||
.main-teaser:after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 0;
|
||||
width: calc(100% + 40px);
|
||||
height: 1px;
|
||||
background: var(--app-accent-color);
|
||||
left: -20px;
|
||||
box-shadow: 0 10px 20px 1px rgb(0 0 0 / 85%);
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.versions {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
gap: 1rem;
|
||||
flex-wrap: wrap;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0 0 20px inset rgb(0 0 0 / 3%);
|
||||
width: 80%;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.versions .item {
|
||||
background: #0000003b;
|
||||
color: #d1d1d1;
|
||||
width: calc(50% - 1rem);
|
||||
padding: 6px 12px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
font-size: 14px;
|
||||
margin: 0;
|
||||
box-sizing: border-box;
|
||||
border-radius: 4px;
|
||||
|
||||
&>* {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
&-icon {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
margin-right: 10px;
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
&>span {
|
||||
color: gray;
|
||||
text-align: right;
|
||||
}
|
||||
}
|
||||
|
||||
#erwt {
|
||||
// user-select: none;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
justify-content: space-between;
|
||||
background: var(--erwt-gradient);
|
||||
|
||||
.header {
|
||||
padding: 4rem 2rem 0rem 2rem;
|
||||
max-width: 700px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.footer {
|
||||
padding: 2rem;
|
||||
background: var(--app-footer-bgColor);
|
||||
padding-bottom: 3rem;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*==========================================================================
|
||||
* Titlebar Overrides for different themes
|
||||
*==========================================================================
|
||||
*/
|
||||
|
||||
.window-titlebar {
|
||||
background: var(--titlebar-bgcolor);
|
||||
height: auto;
|
||||
overflow: hidden;
|
||||
|
||||
&-icon {
|
||||
min-height: 33px;
|
||||
|
||||
img {
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
|
||||
.window-title {
|
||||
color: var(--titlebar-title-color);
|
||||
}
|
||||
|
||||
.menu-item {
|
||||
&.active .menu-title {
|
||||
background: var(--titlebar-menu-title-active-bgcolor);
|
||||
box-shadow: var(--titlebar-menu-title-shadow);
|
||||
color: var(--titlebar-color);
|
||||
border-color: var(--titlebar-menu-title-active-border-color);
|
||||
border-radius: 4px 4px 0 0;
|
||||
border-top-color: var(--app-accent-color);
|
||||
}
|
||||
}
|
||||
|
||||
.menu-title {
|
||||
font-weight: normal;
|
||||
text-shadow: none;
|
||||
color: var(--titlebar-color);
|
||||
border-color: transparent;
|
||||
border-width: 1px 1px 0 1px;
|
||||
border-style: solid;
|
||||
padding: 2px 8px;
|
||||
margin-right: 2px;
|
||||
border-radius: 4px;
|
||||
|
||||
&:hover {
|
||||
background-color: var(--titlebar-menu-title-hover-bgcolor);
|
||||
}
|
||||
}
|
||||
|
||||
.menu-popup {
|
||||
display: none;
|
||||
position: fixed;
|
||||
background-color: var(--titlebar-popup-bgcolor);
|
||||
min-width: 70px;
|
||||
border: var(--titlebar-popup-border);
|
||||
border-top: 0;
|
||||
padding: 0.25rem 0;
|
||||
box-shadow: 4px 10px 10px #0000002e;
|
||||
z-index: 10000;
|
||||
border-radius: 0 6px 6px 6px;
|
||||
|
||||
&-item {
|
||||
padding: 0.3125rem 1rem;
|
||||
|
||||
&:hover {
|
||||
background: var(--titlebar-popup-item-hover-bgcolor);
|
||||
|
||||
.popup-item-shortcut {
|
||||
color: var(--titlebar-popup-item-hover-shortcut-color);
|
||||
}
|
||||
|
||||
.popup-item-name {
|
||||
color: var(--titlebar-popup-item-hover-color);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.popup-item-separator {
|
||||
background: var(--titlebar-menu-separator-bgcolor);
|
||||
}
|
||||
|
||||
.popup-item-name {
|
||||
padding-right: 2rem;
|
||||
color: var(--titlebar-popup-item-name-color);
|
||||
text-shadow: 0px 1px var(--titlebar-popup-item-name-shadow-color);
|
||||
}
|
||||
|
||||
.popup-item-shortcut {
|
||||
color: var(--titlebar-popup-item-shortcut-color);
|
||||
text-shadow: none;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
|
||||
&-controls.type-windows .control {
|
||||
color: var(--titlebar-color);
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
|
||||
&:hover {
|
||||
color: var(--titlebar-color);
|
||||
background: var(--titlebar-popup-item-hover-bgcolor);
|
||||
}
|
||||
|
||||
&.close:hover {
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,57 @@
|
||||
/*
|
||||
*=========================================================================
|
||||
* ERWT Dark Theme
|
||||
*=========================================================================
|
||||
*
|
||||
* Here we define the Dark Theme (stylesheet) for application.
|
||||
*/
|
||||
|
||||
:root {
|
||||
// Application
|
||||
--app-accent-color: #27954f;
|
||||
--app-font-size: 16px;
|
||||
--app-font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI',
|
||||
Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
|
||||
--app-bgcolor: #1d1d1d;
|
||||
--app-border-color: #3b3f44;
|
||||
|
||||
// Scrollbar
|
||||
--scroll-width: 10px;
|
||||
--scroll-track-bgcolor: #2f2f2f52;
|
||||
--scroll-thumb-bgcolor: rgba(59, 59, 59, 0.747);
|
||||
--scroll-thumb-hover-bgcolor: #555;
|
||||
|
||||
// Selection
|
||||
--selection-bgcolor: var(--app-accent-color);
|
||||
--selection-color: #fff;
|
||||
|
||||
// Button
|
||||
--button-color: #fff;
|
||||
--button-border: 1px solid #222424;
|
||||
--button-bgcolor: hsl(0, 0%, 22%);
|
||||
--button-hover-bgcolor: hsl(0, 0%, 24%);
|
||||
--button-active-bgcolor: hsl(0deg 0% 20%);
|
||||
--button-shadow-color: #00000078;
|
||||
|
||||
// Titlebar
|
||||
--titlebar-bgcolor: #252525;
|
||||
--titlebar-color: hsl(0, 0%, 85%);
|
||||
--titlebar-title-color: hsl(0, 0%, 85%);
|
||||
--titlebar-menu-border-color: #2d2c2c;
|
||||
--titlebar-menu-title-hover-bgcolor: hsl(0deg 0% 12%);
|
||||
--titlebar-menu-title-active-bgcolor: #1e1e1e;
|
||||
--titlebar-menu-title-active-border-color: var(--titlebar-menu-border-color);
|
||||
--titlebar-menu-separator-bgcolor: var(--titlebar-menu-border-color);
|
||||
--titlebar-popup-bgcolor: #1e1e1e;
|
||||
--titlebar-popup-border: 1px solid var(--titlebar-menu-border-color);
|
||||
--titlebar-popup-shadow: 4px 10px 10px rgba(0, 0, 0, 0.2);
|
||||
--titlebar-popup-item-name-color: hsl(0, 0%, 75%);
|
||||
--titlebar-popup-item-shortcut-color: hsla(0, 0%, 55%, 0.8);
|
||||
--titlebar-popup-item-hover-color: hsl(0, 0%, 85%);
|
||||
--titlebar-popup-item-hover-bgcolor: hsl(0 0% 16.22%);
|
||||
--titlebar-popup-item-hover-shortcut-color: var(--app-accent-color);
|
||||
--titlebar-popup-item-name-shadow-color: #151515;
|
||||
|
||||
// ERWT
|
||||
--erwt-heading-color: #ddddddec;
|
||||
}
|
||||
@ -0,0 +1,67 @@
|
||||
/*
|
||||
*=========================================================================
|
||||
* ERWT Light Theme
|
||||
*=========================================================================
|
||||
*
|
||||
* Light theme for ERWT application.
|
||||
*/
|
||||
|
||||
body:not(.dark-mode) {
|
||||
// Application
|
||||
--app-accent-color: #27954f;
|
||||
--app-bgcolor: #e2e2e2;
|
||||
|
||||
// Selection
|
||||
--selection-bgcolor: var(--app-accent-color);
|
||||
--selection-color: #fff;
|
||||
|
||||
// Scrollbar
|
||||
--scroll-track-bgcolor: #2f2f2f1f;
|
||||
--scroll-thumb-bgcolor: rgb(59 59 59 / 30%);
|
||||
--scroll-thumb-hover-bgcolor: var(--app-accent-color);
|
||||
|
||||
// Button
|
||||
--button-border: 1px solid #eaeaea;
|
||||
--button-bgcolor: #fff;
|
||||
--button-color: #424242;
|
||||
--button-shadow-color: white;
|
||||
--button-hover-bgcolor: hsl(0, 0%, 98%);
|
||||
--button-active-bgcolor: hsl(0, 0%, 96%);
|
||||
|
||||
// Titlebar
|
||||
--titlebar-bgcolor: #d5d5d5c4;
|
||||
--titlebar-color: #1f1f1f;
|
||||
--titlebar-title-color: var(--titlebar-color);
|
||||
--titlebar-menu-title-hover-bgcolor: #e6e6e69e;
|
||||
--titlebar-popup-bgcolor: hsl(0deg 0% 99%);
|
||||
--titlebar-menu-title-active-bgcolor: hsl(0deg 0% 99%);
|
||||
--titlebar-menu-title-active-border-color: #d3d6d8;
|
||||
--titlebar-popup-border: 1px solid #d3d6d8;
|
||||
--titlebar-menu-separator-bgcolor: #d3d6d8;
|
||||
--titlebar-popup-item-name-color: #0e0e0e;
|
||||
--titlebar-popup-item-name-shadow-color: rgba(255, 255, 255, 0.8);
|
||||
--titlebar-popup-item-hover-color: #000000;
|
||||
--titlebar-popup-item-hover-shortcut-color: var(--app-accent-color);
|
||||
--titlebar-popup-item-hover-bgcolor: #d6dadea2;
|
||||
|
||||
// ERWT
|
||||
--erwt-heading-color: #282828;
|
||||
|
||||
// Overrides
|
||||
.main-teaser {
|
||||
color: #2e2e2e;
|
||||
|
||||
&:after {
|
||||
box-shadow: none;
|
||||
}
|
||||
}
|
||||
|
||||
.versions .item {
|
||||
color: #656565;
|
||||
background: #ffffff5e;
|
||||
|
||||
&>span {
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,33 @@
|
||||
import classNames from 'classnames';
|
||||
import React from 'react';
|
||||
|
||||
interface IControlButtonProps {
|
||||
readonly name: string;
|
||||
readonly path: string;
|
||||
readonly title: string;
|
||||
}
|
||||
|
||||
const ControlButton: React.FC<
|
||||
IControlButtonProps & React.HTMLAttributes<HTMLDivElement>
|
||||
> = (props) => {
|
||||
const { name, path, title, ...rest } = props;
|
||||
const { onClick } = rest;
|
||||
|
||||
const className = classNames('control', name);
|
||||
|
||||
return (
|
||||
<div
|
||||
aria-label={name}
|
||||
className={className}
|
||||
onClick={onClick}
|
||||
title={title}
|
||||
{...rest}
|
||||
>
|
||||
<svg aria-hidden='true' version='1.1' width='10' height='10'>
|
||||
<path fill='currentColor' d={path} />
|
||||
</svg>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default ControlButton;
|
||||
@ -0,0 +1,16 @@
|
||||
Copyright (c) 2021-2022 Guasam
|
||||
|
||||
This software is provided "as-is", without any express or implied warranty. In no event
|
||||
will the authors be held liable for any damages arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose, including commercial
|
||||
applications, and to alter it and redistribute it freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not claim that you
|
||||
wrote the original software. If you use this software in a product, an acknowledgment
|
||||
in the product documentation would be appreciated but is not required.
|
||||
|
||||
2. Altered source versions must be plainly marked as such, and must not be misrepresented
|
||||
as being the original software.
|
||||
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
@ -0,0 +1,196 @@
|
||||
/**
|
||||
* Copyright (c) 2021, Guasam
|
||||
*
|
||||
* This software is provided "as-is", without any express or implied warranty. In no event
|
||||
* will the authors be held liable for any damages arising from the use of this software.
|
||||
* Read the LICENSE file for more details.
|
||||
*
|
||||
* @author : guasam
|
||||
* @project : Electron Window
|
||||
* @package : Window Titlebar (Component)
|
||||
*/
|
||||
|
||||
import React, { createRef, useContext, useEffect, useRef, useState } from 'react';
|
||||
import titlebarMenus from '@main/window/titlebarMenus';
|
||||
import classNames from 'classnames';
|
||||
import WindowControls from './WindowControls';
|
||||
import context from '@main/window/titlebarContextApi';
|
||||
import { WindowContext } from './WindowFrame';
|
||||
import './titlebar.scss';
|
||||
|
||||
type Props = {
|
||||
title: string;
|
||||
mode: 'centered-title';
|
||||
icon?: string;
|
||||
};
|
||||
|
||||
const Titlebar: React.FC<Props> = (props) => {
|
||||
const activeMenuIndex = useRef<number | null>(null);
|
||||
const menusRef = titlebarMenus.map(() => createRef<HTMLDivElement>());
|
||||
const [menusVisible, setMenusVisible] = useState(true);
|
||||
const windowContext = useContext(WindowContext);
|
||||
|
||||
useEffect(() => {
|
||||
const handleKeyDown = (e: KeyboardEvent) => {
|
||||
if (e.repeat) return; // Prevent repeatation of toggle when key holding
|
||||
if (e.altKey) {
|
||||
// Hiding menus? close active menu popup
|
||||
if (menusVisible) {
|
||||
closeActiveMenu();
|
||||
}
|
||||
setMenusVisible(!menusVisible);
|
||||
}
|
||||
};
|
||||
|
||||
document.addEventListener('keydown', handleKeyDown);
|
||||
|
||||
return () => {
|
||||
document.removeEventListener('keydown', handleKeyDown);
|
||||
};
|
||||
}, [menusVisible, menusRef]);
|
||||
|
||||
useEffect(() => {
|
||||
function handleClickOutside(event: MouseEvent) {
|
||||
if (activeMenuIndex.current != null) {
|
||||
if (
|
||||
menusRef[activeMenuIndex.current].current &&
|
||||
!menusRef[activeMenuIndex.current].current?.contains(event.target as Node)
|
||||
) {
|
||||
// console.log('You clicked outside of me!');
|
||||
closeActiveMenu();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (activeMenuIndex != null) {
|
||||
document.addEventListener('mousedown', handleClickOutside);
|
||||
// console.log('added event');
|
||||
}
|
||||
|
||||
return () => {
|
||||
document.removeEventListener('mousedown', handleClickOutside);
|
||||
// console.log('remove event');
|
||||
};
|
||||
}, [activeMenuIndex, menusRef]);
|
||||
|
||||
function showMenu(index: number, e: React.MouseEvent<HTMLDivElement>) {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
|
||||
if (menusRef[index].current?.classList.contains('active')) {
|
||||
// close..
|
||||
closeActiveMenu();
|
||||
} else {
|
||||
// open..
|
||||
menusRef[index].current?.classList.add('active');
|
||||
activeMenuIndex.current = index;
|
||||
menusRef[index].current?.parentElement?.classList.add('active');
|
||||
}
|
||||
}
|
||||
|
||||
function onMenuHover(index: number) {
|
||||
if (activeMenuIndex.current != null) {
|
||||
menusRef[activeMenuIndex.current].current?.classList.toggle('active');
|
||||
menusRef[index].current?.classList.toggle('active');
|
||||
menusRef[index].current?.parentElement?.classList.toggle('active');
|
||||
menusRef[activeMenuIndex.current].current?.parentElement?.classList.toggle(
|
||||
'active',
|
||||
);
|
||||
|
||||
activeMenuIndex.current = index;
|
||||
}
|
||||
}
|
||||
|
||||
function closeActiveMenu() {
|
||||
if (activeMenuIndex.current != null) {
|
||||
menusRef[activeMenuIndex.current].current?.classList.remove('active');
|
||||
menusRef[activeMenuIndex.current]?.current?.parentElement?.classList.remove('active');
|
||||
activeMenuIndex.current = null;
|
||||
}
|
||||
}
|
||||
|
||||
function handleAction(action?: string, value?: string | number) {
|
||||
closeActiveMenu();
|
||||
const c: Record<string, CallableFunction> = context;
|
||||
if (action) {
|
||||
if (typeof c[action] === 'function') {
|
||||
c[action](value);
|
||||
} else {
|
||||
console.log(`action [${action}] is not available in titlebar context`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<div className='window-titlebar'>
|
||||
{props.icon ? (
|
||||
<section className='window-titlebar-icon'>
|
||||
<img src={props.icon} alt='titlebar icon' />
|
||||
</section>
|
||||
) : (
|
||||
''
|
||||
)}
|
||||
|
||||
<section
|
||||
className={classNames('window-titlebar-content', {
|
||||
centered: props.mode === 'centered-title',
|
||||
})}
|
||||
>
|
||||
{menusVisible ? '' : <div className='window-title'>{props.title}</div>}
|
||||
</section>
|
||||
|
||||
<section
|
||||
className={classNames('window-titlebar-menu', {
|
||||
hidden: !menusVisible,
|
||||
})}
|
||||
>
|
||||
{titlebarMenus.map((item, menuIndex) => {
|
||||
return (
|
||||
<div className='menu-item' key={`menu_${menuIndex}`}>
|
||||
<div
|
||||
className='menu-title'
|
||||
onClick={(e) => showMenu(menuIndex, e)}
|
||||
onMouseEnter={() => onMenuHover(menuIndex)}
|
||||
onMouseDown={(e) => e.preventDefault()}
|
||||
>
|
||||
{item.name}
|
||||
</div>
|
||||
<div className='menu-popup' ref={menusRef[menuIndex]}>
|
||||
{item.items?.map((menuItem, menuItemIndex) => {
|
||||
if (menuItem.name === '__') {
|
||||
return (
|
||||
<div
|
||||
key={`menu_${menuIndex}_popup_item_${menuItemIndex}`}
|
||||
className='popup-item-separator'
|
||||
></div>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div
|
||||
key={`menu_${menuIndex}_popup_item_${menuItemIndex}`}
|
||||
className='menu-popup-item'
|
||||
onClick={() =>
|
||||
handleAction(menuItem.action, menuItem.value)
|
||||
}
|
||||
onMouseDown={(e) => e.preventDefault()}
|
||||
>
|
||||
<div className='popup-item-name'>{menuItem.name}</div>
|
||||
<div className='popup-item-shortcut'>
|
||||
{menuItem.shortcut}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</section>
|
||||
|
||||
<WindowControls platform={windowContext.platform} tooltips={true} />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default Titlebar;
|
||||
@ -0,0 +1,59 @@
|
||||
/**
|
||||
* Copyright (c) 2021, Guasam
|
||||
*
|
||||
* This software is provided "as-is", without any express or implied warranty. In no event
|
||||
* will the authors be held liable for any damages arising from the use of this software.
|
||||
* Read the LICENSE file for more details.
|
||||
*
|
||||
* @author : guasam
|
||||
* @project : Electron Window
|
||||
* @package : Window Controls - Close, Minimize, Maximize (Component)
|
||||
*/
|
||||
|
||||
import classNames from 'classnames';
|
||||
import React from 'react';
|
||||
import context from '@main/window/titlebarContextApi';
|
||||
|
||||
import ControlButton from './ControlButton';
|
||||
|
||||
type Props = {
|
||||
platform: string;
|
||||
tooltips?: boolean;
|
||||
};
|
||||
|
||||
const closePath =
|
||||
'M 0,0 0,0.7 4.3,5 0,9.3 0,10 0.7,10 5,5.7 9.3,10 10,10 10,9.3 5.7,5 10,0.7 10,0 9.3,0 5,4.3 0.7,0 Z';
|
||||
const maximizePath = 'M 0,0 0,10 10,10 10,0 Z M 1,1 9,1 9,9 1,9 Z';
|
||||
const minimizePath = 'M 0,5 10,5 10,6 0,6 Z';
|
||||
|
||||
const WindowControls: React.FC<Props> = (props) => {
|
||||
return (
|
||||
<section
|
||||
className={classNames(
|
||||
'window-titlebar-controls',
|
||||
`type-${props.platform}`,
|
||||
)}
|
||||
>
|
||||
<ControlButton
|
||||
name='minimize'
|
||||
onClick={() => context.minimize()}
|
||||
path={minimizePath}
|
||||
title={props.tooltips ? 'Minimize' : null}
|
||||
/>
|
||||
<ControlButton
|
||||
name='maximize'
|
||||
onClick={() => context.toggle_maximize()}
|
||||
path={maximizePath}
|
||||
title={props.tooltips ? 'Maximize' : null}
|
||||
/>
|
||||
<ControlButton
|
||||
name='close'
|
||||
onClick={() => context.exit()}
|
||||
path={closePath}
|
||||
title={props.tooltips ? 'Close' : null}
|
||||
/>
|
||||
</section>
|
||||
);
|
||||
};
|
||||
|
||||
export default WindowControls;
|
||||
@ -0,0 +1,62 @@
|
||||
/**
|
||||
* Copyright (c) 2021, Guasam
|
||||
*
|
||||
* This software is provided "as-is", without any express or implied warranty. In no event
|
||||
* will the authors be held liable for any damages arising from the use of this software.
|
||||
* Read the LICENSE file for more details.
|
||||
*
|
||||
* @author : guasam
|
||||
* @project : Electron Window
|
||||
* @package : Window Frame (Component)
|
||||
*/
|
||||
|
||||
import React, { useEffect, useRef } from 'react';
|
||||
import Titlebar from './Titlebar';
|
||||
import logo from '@assets/images/logo.png';
|
||||
|
||||
type Props = {
|
||||
title?: string;
|
||||
borderColor?: string;
|
||||
platform: 'windows' | 'mac';
|
||||
children: React.ReactNode;
|
||||
};
|
||||
|
||||
type Context = {
|
||||
platform: 'windows' | 'mac';
|
||||
};
|
||||
|
||||
export const WindowContext = React.createContext<Context>({
|
||||
platform: 'windows',
|
||||
});
|
||||
|
||||
const WindowFrame: React.FC<Props> = (props) => {
|
||||
const itsRef = useRef<HTMLDivElement>(null);
|
||||
|
||||
useEffect(() => {
|
||||
const { parentElement } = itsRef.current;
|
||||
parentElement.classList.add('has-electron-window');
|
||||
parentElement.classList.add('has-border');
|
||||
|
||||
// Apply border color if prop given
|
||||
if (props.borderColor) {
|
||||
parentElement.style.borderColor = props.borderColor;
|
||||
}
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<WindowContext.Provider value={{ platform: props.platform }}>
|
||||
{/* Reference creator */}
|
||||
<div className='start-electron-window' ref={itsRef}></div>
|
||||
{/* Window Titlebar */}
|
||||
<Titlebar
|
||||
title={props.title ?? 'Electron Window'}
|
||||
mode='centered-title'
|
||||
icon={logo}
|
||||
/>
|
||||
{/* Window Content (Application to render) */}
|
||||
<div className='window-content'>{props.children}</div>
|
||||
</WindowContext.Provider>
|
||||
);
|
||||
};
|
||||
|
||||
export default WindowFrame;
|
||||
@ -0,0 +1,211 @@
|
||||
$titlebar-baseSize: 16px;
|
||||
$titlebar-height: 28px;
|
||||
$titlebar-bg: #171b21;
|
||||
$titlebar-iconSize: 16px;
|
||||
$em: $titlebar-baseSize*1em;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Window Titlebar
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
.window-titlebar {
|
||||
display: flex;
|
||||
align-items: stretch;
|
||||
font-size: $titlebar-baseSize;
|
||||
height: $titlebar-height;
|
||||
background: $titlebar-bg;
|
||||
-webkit-app-region: drag;
|
||||
user-select: none;
|
||||
position: relative;
|
||||
|
||||
&>section {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
&-content {
|
||||
flex: 1;
|
||||
font-size: calc($titlebar-baseSize - 3px);
|
||||
color: #a9b0bb;
|
||||
|
||||
&.centered {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
|
||||
&-icon {
|
||||
padding: 0 0.75em;
|
||||
|
||||
img {
|
||||
width: $titlebar-iconSize;
|
||||
height: $titlebar-iconSize;
|
||||
}
|
||||
}
|
||||
|
||||
.popup-item {
|
||||
&-name {
|
||||
padding-right: 2rem;
|
||||
color: #d8d8d8;
|
||||
}
|
||||
|
||||
&-shortcut {
|
||||
color: #73757c;
|
||||
text-shadow: none;
|
||||
}
|
||||
|
||||
&-separator {
|
||||
height: 1px;
|
||||
background: #3c4043;
|
||||
margin: 4px 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Titlebar Menu
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
.window-titlebar .menu {
|
||||
flex: 1;
|
||||
|
||||
&-item {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
&-item.active {
|
||||
.menu-title {
|
||||
background: #3c4043;
|
||||
color: #bfbfbf;
|
||||
}
|
||||
}
|
||||
|
||||
&-title {
|
||||
padding: 4px 10px;
|
||||
font-size: 0.8125rem;
|
||||
text-shadow: 0px 1px 1px black;
|
||||
-webkit-app-region: no-drag;
|
||||
color: #97a0b1;
|
||||
|
||||
&:hover {
|
||||
background-color: #1f252c;
|
||||
}
|
||||
}
|
||||
|
||||
&-popup {
|
||||
display: none;
|
||||
position: fixed;
|
||||
background: #292a2d;
|
||||
min-width: 70px;
|
||||
border: 1px solid #3c4043;
|
||||
padding: 0.25rem 0;
|
||||
box-shadow: 2px 1px 4px hsla(0, 0%, 0%, 0.5);
|
||||
z-index: 10000;
|
||||
|
||||
&.active {
|
||||
display: block;
|
||||
}
|
||||
|
||||
&-item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
font-size: 0.8125rem;
|
||||
text-shadow: 0px 1px 1px black;
|
||||
padding: 0.375rem 1rem;
|
||||
|
||||
&:hover {
|
||||
background: #1761cb;
|
||||
|
||||
.popup-item-shortcut {
|
||||
color: #8cbbff;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Titlebar Controls (Max, Min, Close)
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
.window-titlebar-controls {
|
||||
display: flex;
|
||||
align-items: stretch;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
color: #969799;
|
||||
|
||||
&.type-windows {
|
||||
.control {
|
||||
padding: 0 1.15em;
|
||||
font-size: 0.875em;
|
||||
display: flex;
|
||||
height: 100%;
|
||||
align-items: center;
|
||||
-webkit-app-region: no-drag;
|
||||
|
||||
&.close:hover {
|
||||
background: #e10000;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background: #242d38;
|
||||
color: #d8d9db;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.type-mac {
|
||||
.control {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
background: #0e0e0e99;
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-right: 0.675rem;
|
||||
color: transparent;
|
||||
-webkit-app-region: no-drag;
|
||||
opacity: 0.8;
|
||||
|
||||
&:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.control.close {
|
||||
background: #f46d60;
|
||||
}
|
||||
|
||||
.control.maximize {
|
||||
background: #59ca56;
|
||||
}
|
||||
|
||||
.control.minimize {
|
||||
background: #f9c04e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Window Content
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
.window-content {
|
||||
position: relative;
|
||||
overflow: auto;
|
||||
flex: 1;
|
||||
}
|
||||
4
packages/osr-code-bot/kbot-extensions/gui/kbot/src/typings/index.d.ts
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
declare module '*.css';
|
||||
declare module '*.png';
|
||||
declare module '*.jpg';
|
||||
declare module '*.jpeg';
|
||||
@ -0,0 +1,88 @@
|
||||
// Forge Configuration
|
||||
const path = require('path');
|
||||
const rootDir = process.cwd();
|
||||
|
||||
module.exports = {
|
||||
// Packager Config
|
||||
packagerConfig: {
|
||||
// Create asar archive for main, renderer process files
|
||||
asar: true,
|
||||
// Set executable name
|
||||
executableName: 'ERWT',
|
||||
// Set application copyright
|
||||
appCopyright: '© 2021-2024 Codesbiome, Guasam',
|
||||
// Set application icon
|
||||
icon: path.resolve('assets/images/appIcon.ico'),
|
||||
},
|
||||
// Forge Makers
|
||||
makers: [
|
||||
{
|
||||
// Squirrel.Windows is a no-prompt, no-hassle, no-admin method of installing
|
||||
// Windows applications and is therefore the most user friendly you can get.
|
||||
name: '@electron-forge/maker-squirrel',
|
||||
config: {
|
||||
name: 'electron-react-typescript-webpack-2022',
|
||||
},
|
||||
},
|
||||
{
|
||||
// The Zip target builds basic .zip files containing your packaged application.
|
||||
// There are no platform specific dependencies for using this maker and it will run on any platform.
|
||||
name: '@electron-forge/maker-zip',
|
||||
platforms: ['darwin'],
|
||||
},
|
||||
{
|
||||
// The deb target builds .deb packages, which are the standard package format for Debian-based
|
||||
// Linux distributions such as Ubuntu.
|
||||
name: '@electron-forge/maker-deb',
|
||||
config: {},
|
||||
},
|
||||
{
|
||||
// The RPM target builds .rpm files, which is the standard package format for
|
||||
// RedHat-based Linux distributions such as Fedora.
|
||||
name: '@electron-forge/maker-rpm',
|
||||
config: {},
|
||||
},
|
||||
],
|
||||
// Forge Plugins
|
||||
plugins: [
|
||||
{
|
||||
name: '@electron-forge/plugin-webpack',
|
||||
config: {
|
||||
// Fix content-security-policy error when image or video src isn't same origin
|
||||
// Remove 'unsafe-eval' to get rid of console warning in development mode.
|
||||
devContentSecurityPolicy: `default-src 'self' 'unsafe-inline' data:; script-src 'self' 'unsafe-inline' data:`,
|
||||
// Webpack Dev Server port
|
||||
port: 3000,
|
||||
// Logger port
|
||||
loggerPort: 9000,
|
||||
// Main process webpack configuration
|
||||
mainConfig: path.join(rootDir, 'tools/webpack/webpack.main.js'),
|
||||
// Renderer process webpack configuration
|
||||
renderer: {
|
||||
// Configuration file path
|
||||
config: path.join(rootDir, 'tools/webpack/webpack.renderer.js'),
|
||||
// Entrypoints of the application
|
||||
entryPoints: [
|
||||
{
|
||||
// Window process name
|
||||
name: 'app_window',
|
||||
// React Hot Module Replacement (HMR)
|
||||
rhmr: 'react-hot-loader/patch',
|
||||
// HTML index file template
|
||||
html: path.join(rootDir, 'src/renderer/app.html'),
|
||||
// App Renderer
|
||||
js: path.join(rootDir, 'src/renderer/appRenderer.tsx'),
|
||||
// App Preload
|
||||
preload: {
|
||||
js: path.join(rootDir, 'src/renderer/appPreload.tsx'),
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
devServer: {
|
||||
liveReload: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
@ -0,0 +1,12 @@
|
||||
const { createWebpackAliases } = require('./webpack.helpers');
|
||||
|
||||
// Export aliases
|
||||
module.exports = createWebpackAliases({
|
||||
'@assets': 'assets',
|
||||
'@components': 'src/renderer/components',
|
||||
'@common': 'src/common',
|
||||
'@main': 'src/main',
|
||||
'@renderer': 'src/renderer',
|
||||
'@src': 'src',
|
||||
'@styles': 'src/renderer/styles',
|
||||
});
|
||||
@ -0,0 +1,20 @@
|
||||
const path = require('path');
|
||||
const cwd = process.cwd();
|
||||
|
||||
|
||||
function inDev() {
|
||||
return process.env.NODE_ENV == 'development';
|
||||
}
|
||||
|
||||
function createWebpackAliases (aliases) {
|
||||
const result = {};
|
||||
for (const name in aliases) {
|
||||
result[name] = path.join(cwd, aliases[name]);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
inDev,
|
||||
createWebpackAliases,
|
||||
};
|
||||
@ -0,0 +1,16 @@
|
||||
module.exports = {
|
||||
/**
|
||||
* This is the main entry point for your application, it's the first file
|
||||
* that runs in the main process.
|
||||
*/
|
||||
entry: ['./src/main/app.ts'],
|
||||
// Put your normal webpack config below here
|
||||
module: {
|
||||
rules: require('./webpack.rules'),
|
||||
},
|
||||
resolve: {
|
||||
extensions: ['.js', '.ts', '.jsx', '.tsx', '.css', '.json'],
|
||||
alias: require('./webpack.aliases'),
|
||||
},
|
||||
stats: 'minimal',
|
||||
};
|
||||
@ -0,0 +1,10 @@
|
||||
const webpack = require('webpack');
|
||||
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
|
||||
const ReactRefreshWebpackPlugin = require('@pmmmwh/react-refresh-webpack-plugin');
|
||||
const { inDev } = require('./webpack.helpers');
|
||||
|
||||
module.exports = [
|
||||
new ForkTsCheckerWebpackPlugin(),
|
||||
inDev() && new webpack.HotModuleReplacementPlugin(),
|
||||
inDev() && new ReactRefreshWebpackPlugin(),
|
||||
].filter(Boolean);
|
||||