Skip to content

Commit

Permalink
Update docs for the latest framework release
Browse files Browse the repository at this point in the history
  • Loading branch information
shalithasuranga committed Mar 22, 2024
1 parent 0f0e429 commit 466baad
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 2 deletions.
47 changes: 47 additions & 0 deletions docs/api/clipboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@ title: Neutralino.clipboard

`Neutralino.clipboard` namespace offers functions to access system clipboard.

## clipboard.getFormat()
Returns the current data format of the system clipboard. 

### Return String (awaited):
Clipboard format: `text`, `image`, or `unknown`.


```js
let format = await Neutralino.clipboard.getFormat();
console.log(`Format: ${format}`);
```

## clipboard.writeText(text)
Writes text into the system clipboard. 

Expand All @@ -15,6 +27,28 @@ Writes text into the system clipboard. 
await Neutralino.clipboard.writeText('Test value');
```

## clipboard.writeImage(image)
Writes image into the system clipboard. 

### Input Object: `ClipboardImage`

- `width`: Number: Image width.
- `height`: Number: Image height.
- `bpp`: Number: Bits per pixel (BPP).
- `bpr`: Number: Bytes Per Row (BPR).
- `redMask`: Number: Red mask.
- `greenMask`: Number: Green mask.
- `blueMask`: Number: Blue mask.
- `redShift`: Number: Red shift.
- `greeShift`: Number: Green shift.
- `blueShif`: Number: Blue shift.
- `data`: ArrayBuffer: Raw RGBA binary data data of the image in an array buffer.

```js
let image = prepareClipboardImage();
await Neutralino.clipboard.writeImage(image);
```

## clipboard.readText()
Reads and returns text from system clipboard. 

Expand All @@ -26,3 +60,16 @@ Stored text from the system clipboard.
let clipboardText = await Neutralino.clipboard.readText();
console.log(`Text: ${clipboardText}`);
```

## clipboard.readImage()
Reads and returns an image from system clipboard. 

### Return Object (awaited):
Returns [`ClipboardImage`](#input-object-clipboardimage) object that has the same
properties as in the [`writeImage()`](#clipboardwriteimageimage) function.


```js
let clipboardImage = await Neutralino.clipboard.readImage();
console.log(`Image: ${clipboardImage}`);
```
4 changes: 4 additions & 0 deletions docs/cli/internal-cli-arguments.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,10 @@ Overrides the window top (`y`) position.

Overrides the window's initial center positioning setup.

### `--window-transparent=<true|false>`

Overrides the window transparency mode.

### `--window-resizable=<true|false>`

Overrides the window's initial resizability status.
Expand Down
12 changes: 12 additions & 0 deletions docs/configuration/neutralino.config.json.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,18 @@ Right position (`y`) of the native window.
### `modes.window.center: boolean`
Centers the native app window initially.

### `modes.window.trasparent: boolean`
Enables the transparent native window mode for the application instance. If the transparency mode is activated,
users can see through the webview if the webpage background uses transparent background colors. Partial transparency
can be activated using the `rgba()` CSS color function. You can use this feature to create semi-transparent
windows, windows with custom shadows, and custom-shaped window frames.

The default value is `false` for this option.

:::info
This feature is only available on GNU/Linux and Mac systems and will be implemented soon on Windows.
:::

### `modes.window.fullScreen: boolean`
Activates the full-screen mode.

Expand Down
5 changes: 5 additions & 0 deletions docs/release-notes/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ title: CLI

## Unreleased

## v11.1.0

### Core: Bundler
- Add `cli.distributionPath` into the `neutralino.config.json` file to customize the default `dist` distribution directory.

## v11.0.1

### Bugfixes/improvements
Expand Down
13 changes: 11 additions & 2 deletions docs/release-notes/client-library.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ title: Client Library

## Unreleased

## v5.1.0

### API: clipboard
- Export new framework functions: `clipboard.getFormat()`, `clipboard.readImage()`, and `clipboard.writeImage(image)`.

### TypeScript
- Separate type definitions into a new directory to improve project structure.
- Add missing type definitions.

## v5.0.1

### TypeScript
Expand Down Expand Up @@ -49,7 +58,7 @@ title: Client Library
## v3.8.2

### NPM/ESM support
- Add ESM support for the client library via `neutralino.mjs`.
- Add ESM support for the client library via `neutralino.mjs`.
- Publish (and automate) the client library as an NPM package,`@neutralinojs/lib`.

## v3.8.0
Expand Down Expand Up @@ -102,7 +111,7 @@ title: Client Library

### API: init
- Store `NL_TOKEN` in sessionStorage and handle native API calls after page reload.
- Show a message to the user via HTML if `NL_TOKEN` is not valid (Eg: when the user tries to open the app from another client with `one-time` token).
- Show a message to the user via HTML if `NL_TOKEN` is not valid (Eg: when the user tries to open the app from another client with `one-time` token).

### API: window
- Add `window.setAlwaysOnTop(bool)`.
Expand Down
4 changes: 4 additions & 0 deletions docs/release-notes/framework.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ title: Framework

## Unreleased

## v5.1.0

### Configuration: window transparency
Neutralinojs offers the inbuilt borderless mode and draggable region API to create custom window frames using HTML and CSS. Earlier, Neutralinojs used a default opaque color (usually white) for the window and webview layer, so app developers couldn't make custom CSS-styled window frames transparent or implement custom window frame shapes (i.e., rounded edges). Now, it offers the `window.transparent` boolean flag to activate window transparency.

Expand All @@ -14,7 +16,9 @@ The transparency mode can be activated using the `--window-transparent=<bool>` i
*Note: This feature is not implemented for the Windows operating system yet.*

### API: clipboard
- Implement `clipboard.readImage()` and `clipboard.writeImage(image)` functions to work with clipboard image data.
- Expose the `clipboard.clear()` function to clear system clipboard.
- Expose the `clipboard.getFormat()` function to check the system clipboard data format. This function returns `text`, `image`, and `unknown` enum values based on existing data on the clipboard.

## v5.0.0

Expand Down

0 comments on commit 466baad

Please sign in to comment.