Repository: wulkano/Kap Branch: main Commit: c42692fa63ac Files: 225 Total size: 521.9 KB Directory structure: gitextract_nqp269lp/ ├── .circleci/ │ └── config.yml ├── .editorconfig ├── .gitattributes ├── .github/ │ └── ISSUE_TEMPLATE.md ├── .gitignore ├── .npmrc ├── CODE_OF_CONDUCT.md ├── LICENSE.md ├── PRIVACY.md ├── README.md ├── build/ │ ├── entitlements.mac.inherit.plist │ └── icon.icns ├── contributing.md ├── docs/ │ └── plugins.md ├── main/ │ ├── aperture.ts │ ├── common/ │ │ ├── accelerator-validator.ts │ │ ├── analytics.ts │ │ ├── constants.ts │ │ ├── flags.ts │ │ ├── settings.ts │ │ ├── system-permissions.ts │ │ └── types/ │ │ ├── base.ts │ │ ├── conversion-options.ts │ │ ├── index.ts │ │ ├── remote-states.ts │ │ └── window-states.ts │ ├── conversion.ts │ ├── converters/ │ │ ├── h264.ts │ │ ├── index.ts │ │ ├── process.ts │ │ └── utils.ts │ ├── export.ts │ ├── global-accelerators.ts │ ├── index.ts │ ├── menus/ │ │ ├── application.ts │ │ ├── cog.ts │ │ ├── common.ts │ │ ├── record.ts │ │ └── utils.ts │ ├── plugins/ │ │ ├── built-in/ │ │ │ ├── copy-to-clipboard-plugin.ts │ │ │ ├── open-with-plugin.ts │ │ │ └── save-file-plugin.ts │ │ ├── config.ts │ │ ├── index.ts │ │ ├── plugin.ts │ │ ├── service-context.ts │ │ └── service.ts │ ├── recording-history.ts │ ├── remote-states/ │ │ ├── editor-options.ts │ │ ├── exports-list.ts │ │ ├── exports.ts │ │ ├── index.ts │ │ ├── setup-remote-state.ts │ │ └── utils.ts │ ├── tray.ts │ ├── utils/ │ │ ├── ajv.ts │ │ ├── deep-linking.ts │ │ ├── devices.ts │ │ ├── dock.ts │ │ ├── encoding.ts │ │ ├── errors.ts │ │ ├── ffmpeg-path.ts │ │ ├── format-time.ts │ │ ├── formats.ts │ │ ├── fps.ts │ │ ├── image-preview.ts │ │ ├── macos-release.ts │ │ ├── notifications.ts │ │ ├── open-files.ts │ │ ├── protocol.ts │ │ ├── routes.ts │ │ ├── sentry.ts │ │ ├── shortcut-to-accelerator.ts │ │ ├── timestamped-name.ts │ │ ├── track-duration.ts │ │ └── windows.ts │ ├── video.ts │ └── windows/ │ ├── config.ts │ ├── cropper.ts │ ├── dialog.ts │ ├── editor.ts │ ├── exports.ts │ ├── kap-window.ts │ ├── load.ts │ ├── manager.ts │ └── preferences.ts ├── maintaining.md ├── package.json ├── renderer/ │ ├── components/ │ │ ├── action-bar/ │ │ │ ├── controls/ │ │ │ │ ├── advanced.js │ │ │ │ └── main.js │ │ │ ├── index.js │ │ │ └── record-button.js │ │ ├── config/ │ │ │ ├── index.js │ │ │ └── tab.js │ │ ├── cropper/ │ │ │ ├── cursor.js │ │ │ ├── handles.js │ │ │ ├── index.js │ │ │ └── overlay.js │ │ ├── dialog/ │ │ │ ├── actions.js │ │ │ ├── body.js │ │ │ └── icon.js │ │ ├── editor/ │ │ │ ├── controls/ │ │ │ │ ├── left.tsx │ │ │ │ ├── play-bar.tsx │ │ │ │ ├── preview.tsx │ │ │ │ └── right.tsx │ │ │ ├── conversion/ │ │ │ │ ├── conversion-details.tsx │ │ │ │ ├── index.tsx │ │ │ │ ├── title-bar.tsx │ │ │ │ └── video-preview.tsx │ │ │ ├── editor-preview.tsx │ │ │ ├── index.tsx │ │ │ ├── options/ │ │ │ │ ├── index.tsx │ │ │ │ ├── left.tsx │ │ │ │ ├── right.tsx │ │ │ │ ├── select.tsx │ │ │ │ └── slider.tsx │ │ │ ├── options-container.tsx │ │ │ ├── video-controls-container.tsx │ │ │ ├── video-metadata-container.tsx │ │ │ ├── video-player.tsx │ │ │ ├── video-time-container.tsx │ │ │ └── video.tsx │ │ ├── exports/ │ │ │ ├── export.tsx │ │ │ ├── index.tsx │ │ │ └── progress.tsx │ │ ├── icon-menu.tsx │ │ ├── keyboard-number-input.js │ │ ├── preferences/ │ │ │ ├── categories/ │ │ │ │ ├── category.js │ │ │ │ ├── general.js │ │ │ │ ├── index.js │ │ │ │ └── plugins/ │ │ │ │ ├── index.js │ │ │ │ ├── plugin.js │ │ │ │ └── tab.js │ │ │ ├── item/ │ │ │ │ ├── button.js │ │ │ │ ├── color-picker.js │ │ │ │ ├── index.js │ │ │ │ ├── select.js │ │ │ │ └── switch.js │ │ │ ├── navigation.js │ │ │ └── shortcut-input.js │ │ ├── traffic-lights.tsx │ │ └── window-header.js │ ├── containers/ │ │ ├── action-bar.js │ │ ├── config.js │ │ ├── cropper.js │ │ ├── cursor.js │ │ ├── index.js │ │ └── preferences.js │ ├── hooks/ │ │ ├── dark-mode.tsx │ │ ├── editor/ │ │ │ ├── use-conversion-id.tsx │ │ │ ├── use-conversion.tsx │ │ │ ├── use-editor-options.tsx │ │ │ ├── use-editor-window-state.tsx │ │ │ ├── use-share-plugins.tsx │ │ │ └── use-window-size.tsx │ │ ├── exports/ │ │ │ └── use-exports-list.tsx │ │ ├── use-confirmation.tsx │ │ ├── use-current-window.tsx │ │ ├── use-keyboard-action.tsx │ │ ├── use-remote-state.tsx │ │ ├── use-show-window.tsx │ │ └── window-state.tsx │ ├── next-env.d.ts │ ├── next.config.js │ ├── pages/ │ │ ├── _app.tsx │ │ ├── config.js │ │ ├── cropper.js │ │ ├── dialog.js │ │ ├── editor.tsx │ │ ├── exports.tsx │ │ └── preferences.js │ ├── tsconfig.eslint.json │ ├── tsconfig.json │ ├── utils/ │ │ ├── combine-unstated-containers.tsx │ │ ├── format-time.js │ │ ├── global-styles.tsx │ │ ├── inputs.js │ │ ├── sentry-error-boundary.tsx │ │ └── window.ts │ └── vectors/ │ ├── applications.js │ ├── back-plain.tsx │ ├── back.js │ ├── cancel.js │ ├── crop.js │ ├── dropdown-arrow.js │ ├── edit.js │ ├── error.js │ ├── exit-fullscreen.js │ ├── fullscreen.js │ ├── gear.js │ ├── help.js │ ├── index.js │ ├── link.js │ ├── more.js │ ├── open-config.js │ ├── open-on-github.js │ ├── pause.js │ ├── play.js │ ├── plugins.js │ ├── settings.js │ ├── spinner.js │ ├── svg.tsx │ ├── swap.js │ ├── tooltip.js │ ├── tune.js │ ├── volume-high.js │ └── volume-off.js ├── test/ │ ├── convert.ts │ ├── helpers/ │ │ ├── assertions.ts │ │ ├── mocks.ts │ │ └── video-utils.ts │ ├── mocks/ │ │ ├── analytics.ts │ │ ├── dialog.ts │ │ ├── electron-store.ts │ │ ├── electron.ts │ │ ├── plugins.ts │ │ ├── sentry.ts │ │ ├── service-context.ts │ │ ├── settings.ts │ │ ├── video.ts │ │ └── window-manager.ts │ ├── recording-history.ts │ └── tsconfig.json ├── tsconfig.eslint.json └── tsconfig.json ================================================ FILE CONTENTS ================================================ ================================================ FILE: .circleci/config.yml ================================================ version: 2 jobs: build: macos: xcode: '13.4.1' steps: - checkout - run: yarn - run: mkdir -p ~/reports - run: yarn lint - run: yarn test:ci - run: yarn run dist - run: mv dist/*-x64.dmg dist/Kap-x64.dmg - run: mv dist/*-arm64.dmg dist/Kap-arm64.dmg - store_artifacts: path: dist/Kap-x64.dmg - store_artifacts: path: dist/Kap-arm64.dmg - store_test_results: path: ~/reports sentry-release: docker: - image: cimg/node:lts environment: SENTRY_ORG: wulkano-l0 SENTRY_PROJECT: kap steps: - checkout - run: | curl -sL https://sentry.io/get-cli/ | bash export SENTRY_RELEASE=$(yarn run -s sentry-version) sentry-cli releases new -p $SENTRY_PROJECT $SENTRY_RELEASE sentry-cli releases set-commits --auto $SENTRY_RELEASE sentry-cli releases finalize $SENTRY_RELEASE workflows: version: 2 build: jobs: - build: filters: tags: only: /.*/ # Force CircleCI to build on tags - sentry-release: requires: - build filters: tags: only: /^v.*/ branches: ignore: /.*/ ================================================ FILE: .editorconfig ================================================ root = true [*] indent_style = space indent_size = 2 end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true ================================================ FILE: .gitattributes ================================================ * text=auto eol=lf ================================================ FILE: .github/ISSUE_TEMPLATE.md ================================================ **macOS version:** **Kap version:** #### Steps to reproduce #### Current behaviour #### Expected behaviour #### Workaround ================================================ FILE: .gitignore ================================================ node_modules /renderer/out /renderer/.next /app/dist /dist /dist-js ================================================ FILE: .npmrc ================================================ package-lock=false ================================================ FILE: CODE_OF_CONDUCT.md ================================================ # Contributor Covenant Code of Conduct ## Our Pledge In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. ## Our Standards Examples of behavior that contributes to creating a positive environment include: * Using welcoming and inclusive language * Being respectful of differing viewpoints and experiences * Gracefully accepting constructive criticism * Focusing on what is best for the community * Showing empathy towards other community members Examples of unacceptable behavior by participants include: * The use of sexualized language or imagery and unwelcome sexual attention or advances * Trolling, insulting/derogatory comments, and personal or political attacks * Public or private harassment * Publishing others' private information, such as a physical or electronic address, without explicit permission * Other conduct which could reasonably be considered inappropriate in a professional setting ## Our Responsibilities Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. Project maintainers 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, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. ## Scope This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at hello@wulkano.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. ## Attribution This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] [homepage]: http://contributor-covenant.org [version]: http://contributor-covenant.org/version/1/4/ ================================================ FILE: LICENSE.md ================================================ MIT License Copyright (c) Wulkano hello@wulkano.com (https://wulkano.com) 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. ================================================ FILE: PRIVACY.md ================================================ # Your privacy Even though Kap is open-source and not in the business of monetizing the product itself nor your data, directly or indirectly, we feel it's important to share how we think about, collect and use insights we gain on how Kap is used through certain [third party services](#third-party-services). The short version is that we respect your privacy, aim to give you as much choice and control as possible, and try to gather only the minimum amount of data absolutely necessary to help us make Kap better for you and everyone else. ### Security All our traffic is served over [HTTPS](https://en.wikipedia.org/wiki/HTTPS). Our SSL/TLS certificate is issued by [Let's Encrypt](https://letsencrypt.org). In addition to encryption, we do our best to stay vigilant and implement precautionary measures to avoid breaches or misuse. ### Cookies We do not allow any [third-party cookies](https://en.wikipedia.org/wiki/HTTP_cookie#Third-party_cookie) and do not attempt to identify you, track you or associate your data across devices and services, nor do we use cookies to serve advertising. **Authorised cookies:** - `_g` for Google Analytics - `_gat_gtag_UA_84705099_3` for Google Analytics - `_gid` for Google Analytics You are of course free to block and remove cookies. You will typically find these options in the address bar of your browser. [Learn more about our use of Google Analytics](#google-analytics-gdpr-compliant). ## Third-party services An overview of third-party services that have access to, collect or generate data based on your usage. ### Google Analytics (GDPR Compliant) We do not (and do not allow third-parties to) use our Google Analytics data to track or collect personally identifiable information, nor do we (or do we allow any third-party to) associate data gathered with any personally identifying information from any source. [Google Analytics data is not shared with other Google products and services](https://support.google.com/analytics/answer/1011397), and is not accessible to Google technical support representatives or Google marketing specialists. We do not collect or use [user specific metrics](https://support.google.com/analytics/answer/2992042), nor do we [associate data from different devices](https://support.google.com/analytics/answer/3123662). No [Enhanced Link Attribution](https://support.google.com/analytics/answer/7377126) or [Demographics and Interests reports](https://support.google.com/analytics/answer/2799357) are used or generated, nor do we [track your search queries on our site](https://support.google.com/analytics/answer/1012264). We also do not collect data for [Display and Search Remarketing or Advertising Reporting features](https://support.google.com/analytics/answer/3450482). Google Analytics data for inactive sessions are retained for the [shortest currently available time](https://support.google.com/analytics/answer/7667196) (14 months). We can however retain analytics data for active sessions longer. We ask Google Analytics to [anonymize your IP address](https://support.google.com/analytics/answer/2763052). - [Google Privacy Policy](https://policies.google.com/privacy) - [How Google Analytics safeguards your data](https://support.google.com/analytics/answer/6004245) - [Privacy Shield Certificate](https://www.privacyshield.gov/participant?id=a2zt000000001L5AAI) ### Sentry (GDPR Compliant) We prevent Sentry from storing IP Addresses, in addition to requiring enhanced privacy controls and data scrubbers be applied to prevent [sensitive data](https://docs.sentry.io/learn/sensitive-data/) being stored. - [Security & Compliance at Sentry](https://sentry.io/security/) - [GDPR, Sentry, and You](https://blog.sentry.io/2018/03/14/gdpr-sentry-and-you) - [Privacy Shield Certificate](https://www.privacyshield.gov/participant?id=a2zt0000000TNDzAAO) ### MailChimp (GDPR Compliant) We are compliant with [MailChimp Terms of Use and anti-spam requirements](https://kb.mailchimp.com/accounts/compliance-tips/terms-of-use-and-anti-spam-requirements) (CAN-SPAM). When you provide your name and email address to [receive email updates](http://eepurl.com/ch90_1) from us, you acknowledge that the information you provide will be transferred to MailChimp for processing in accordance with their [Privacy Policy](https://mailchimp.com/legal/privacy/) and [Terms](https://mailchimp.com/legal/terms/). We do not allow MailChimp to use your information in their data science projects. You can unsubscribe from emails regarding Kap at any time by using the unsubscribe link in the footer of any email you receive from us, or by contacting us at hello@wulkano.com. - [About MailChimp, the EU/Swiss Privacy Shield, and the GDPR](https://kb.mailchimp.com/accounts/management/about-mailchimp-the-eu-swiss-privacy-shield-and-the-gdpr) - [Privacy Shield Certificate](https://www.privacyshield.gov/participant?id=a2zt0000000TO6hAAG) ## Help us do even better We'd love to hear from you! [Open an issue](https://github.com/wulkano/kap/issues/new) or [send an email](mailto:hello@wulkano.com) to help shape and strengthen our stance on privacy. *Updated May 24, 2018* ================================================ FILE: README.md ================================================
An open-source screen recorder built with web technology
[](https://vshymanskyy.github.io/StandWithUkraine/) ## Get Kap Download the latest release: - [Apple silicon](https://getkap.co/api/download/arm64) - [Intel](https://getkap.co/api/download/x64) Or install with [Homebrew-Cask](https://caskroom.github.io): ```sh brew install --cask kap ``` ## How To Use Kap Click the menu bar icon to bring up the screen recorder. After selecting what portion of the screen you'd like to record, hit the record button to start recording. Click the menu bar icon again to stop the recording. > Tip: While recording, Option-click the menu bar icon to pause or right-click for more options. ## Contribute Read the [contribution guide](contributing.md). ## Plugins For more info on how to create plugins, read the [plugins docs](docs/plugins.md). ## Dev builds Download [`main`](https://kap-artifacts.now.sh/main) or builds for any other branch using: `https://kap-artifacts.now.sh/
```
| Save to Disk |
| Upload to Dropbox |
| Share on GIPHY |
```
In the above case, the second and third item are added by two different share services.
The share service is a plain object defining some metadata:
- `title`: The title used in the export menu. For example: `Share to GIPHY`.
#### `keyboardShortcut`
[List of possible values](https://www.electronjs.org/docs/api/accelerator)
```js
const config = {
keyboardShortcut: {
title: 'Toggle Unicorn Mode',
customType: 'keyboardShortcut',
required: true,
default: 'Command+Shift+5'
}
};
// Later
electron.globalShortcut.register(config.get('shortcut'), () => { /* ... */ });
```
**Note:** Kap will not register any action for the keyboard shortcut. That is up to the plugin implementation.
## General APIs
Every type of plugin and service can additionally export the following:
- `didInstall(config)`: A hook that will be called when the plugin is first installed.
- `didConfigChange(newValues, oldValues, config)`: A hook that will be called whenever the config of the plugin is changed.
- `willUninstall(config)`: A hook that will be called when a plugin is being uninstalled. It can be used to clean up artifacts.
In addition to these, each plugin needs to export at least one of the following:
- `shareServices`: an array of share services and described above
- `editServices`: an array of edit services and described above
- `recordServices`: an array of record services and described above
## OAuth
Sometimes services require an [OAuth](https://oauth.net/2/) flow to retrieve a token. These flows are often required to be completed in the browser and not in a webview. For this reason, Kap provides deep linking support. Follow these steps to support OAuth in your plugin:
- When the export starts, check if the `accessToken` is available (if you have already authenticated) in the plugin config. This should not be listed in the JSON Schema options mentioned above unless the user is meant to edit them.
- If it's not available, [open an external link](https://www.electronjs.org/docs/api/shell#shellopenexternalurl-options) to the OAuth provider's page with the correct parameters. Usually client ID.
- When registering the app, provide something like `kap://plugins/{pluginName}/auth` as the callback URL.
- Call `context.waitForDeepLink()` and wait for the user to go through the process.
- When the above call resolves, you'll have the remaining path, along with any extra info the API added. In the above example, it would be something like `auth?code=###`.
- You can now exchange the code for a token, and then store that in the config, so you can use it for future exports.
For an example of this flow in action, check out [kap-dropbox](https://github.com/karaggeorge/kap-dropbox).
If the API provider only allows HTTP/HTTPS URLs, or if you don't want to do the code exchange in the plugin (to avoid having the secret in the code), you might need to create a proxy, similar to the [one used for kap-dropbox](https://github.com/karaggeorge/kap-dropbox/tree/main/oauth-proxy), to trigger the deep link.
## Removing your Kap plugin
Since npm doesn't allow you to remove packages from the registry, Kap filters out deprecated packages in the plugin list.
When you are ready to retire your Kap plugin, simply run `npm deprecate kap-plugin "Deprecated"`.
[Read more about the `npm-deprecate` command](https://docs.npmjs.com/cli/deprecate)
================================================
FILE: main/aperture.ts
================================================
import {windowManager} from './windows/manager';
import {setRecordingTray, setPausedTray, disableTray, resetTray} from './tray';
import {setCropperShortcutAction} from './global-accelerators';
import {settings} from './common/settings';
import {track} from './common/analytics';
import {plugins} from './plugins';
import {getAudioDevices, getSelectedInputDeviceId} from './utils/devices';
import {showError} from './utils/errors';
import {RecordServiceContext, RecordServiceState} from './plugins/service-context';
import {setCurrentRecording, updatePluginState, stopCurrentRecording} from './recording-history';
import {Recording} from './video';
import {ApertureOptions, StartRecordingOptions} from './common/types';
import {InstalledPlugin} from './plugins/plugin';
import {RecordService, RecordServiceHook} from './plugins/service';
import {getCurrentDurationStart, getOverallDuration, setCurrentDurationStart, setOverallDuration} from './utils/track-duration';
const createAperture = require('aperture');
const aperture = createAperture();
let recordingPlugins: Array<{plugin: InstalledPlugin; service: RecordService}> = [];
const serviceState = new Map