git0 0.2.11 → 0.2.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/assets/js/c3a618e1.965a31da.js +1 -1
- package/docs/functions/index.html +2 -2
- package/docs-config/src/functions/index.md +1 -1
- package/package.json +2 -1
- package/readme.md +18 -30
- package/src/fm.js +1130 -0
- package/src/git0.js +3 -4
- package/src/github-api.js +14 -15
- package/TypeScript-React-Starter/LICENSE +0 -21
- package/TypeScript-React-Starter/README-CRA.md +0 -1281
- package/TypeScript-React-Starter/README.md +0 -810
- package/TypeScript-React-Starter/package.json +0 -28
- package/TypeScript-React-Starter/public/favicon.ico +0 -0
- package/TypeScript-React-Starter/public/index.html +0 -31
- package/TypeScript-React-Starter/src/App.css +0 -24
- package/TypeScript-React-Starter/src/App.test.tsx +0 -8
- package/TypeScript-React-Starter/src/App.tsx +0 -23
- package/TypeScript-React-Starter/src/actions/index.tsx +0 -24
- package/TypeScript-React-Starter/src/components/Hello.css +0 -13
- package/TypeScript-React-Starter/src/components/Hello.test.tsx +0 -30
- package/TypeScript-React-Starter/src/components/Hello.tsx +0 -35
- package/TypeScript-React-Starter/src/constants/index.tsx +0 -6
- package/TypeScript-React-Starter/src/containers/Hello.tsx +0 -20
- package/TypeScript-React-Starter/src/index.css +0 -5
- package/TypeScript-React-Starter/src/index.tsx +0 -22
- package/TypeScript-React-Starter/src/logo.svg +0 -7
- package/TypeScript-React-Starter/src/reducers/index.tsx +0 -15
- package/TypeScript-React-Starter/src/types/index.tsx +0 -5
- package/TypeScript-React-Starter/tsconfig.json +0 -29
- package/TypeScript-React-Starter/tslint.json +0 -11
- package/TypeScript-React-Starter/yarn.lock +0 -4785
- package/svelte-nodegui/.all-contributorsrc +0 -60
- package/svelte-nodegui/.vscode/launch.json +0 -29
- package/svelte-nodegui/CHANGELOG.md +0 -153
- package/svelte-nodegui/LICENSE +0 -22
- package/svelte-nodegui/README.md +0 -151
- package/svelte-nodegui/demo/.editorconfig +0 -15
- package/svelte-nodegui/demo/.vscode/extensions.json +0 -3
- package/svelte-nodegui/demo/livereload.js +0 -29
- package/svelte-nodegui/demo/package-lock.json +0 -3514
- package/svelte-nodegui/demo/package.json +0 -35
- package/svelte-nodegui/demo/src/App.svelte +0 -29
- package/svelte-nodegui/demo/src/app.ts +0 -31
- package/svelte-nodegui/demo/tsconfig.json +0 -40
- package/svelte-nodegui/demo/webpack.config.js +0 -110
- package/svelte-nodegui/extras/assets/kitchen.png +0 -0
- package/svelte-nodegui/extras/assets/nodegui.png +0 -0
- package/svelte-nodegui/extras/assets/nodegui_white.png +0 -0
- package/svelte-nodegui/extras/assets/start_icon.png +0 -0
- package/svelte-nodegui/extras/legal/logo/thanks.md +0 -13
- package/svelte-nodegui/extras/legal/yode/LICENSE +0 -21
- package/svelte-nodegui/extras/legal/yoga/LICENSE +0 -0
- package/svelte-nodegui/extras/logo/nodegui-circle.png +0 -0
- package/svelte-nodegui/extras/logo/nodegui.png +0 -0
- package/svelte-nodegui/extras/logo/nodegui.svg +0 -4
- package/svelte-nodegui/nativescript-svelte-todo.gif +0 -0
- package/svelte-nodegui/package-lock.json +0 -1749
- package/svelte-nodegui/package.json +0 -44
- package/svelte-nodegui/repl-workers/bundler/commonjs.js +0 -58
- package/svelte-nodegui/repl-workers/bundler/index.js +0 -353
- package/svelte-nodegui/repl-workers/package-lock.json +0 -484
- package/svelte-nodegui/repl-workers/package.json +0 -21
- package/svelte-nodegui/repl-workers/rollup.config.js +0 -21
- package/svelte-nodegui/rollup.config.js +0 -81
- package/svelte-nodegui/scripts/create-pkg.js +0 -42
- package/svelte-nodegui/src/components/AsComponent.svelte +0 -16
- package/svelte-nodegui/src/components/SlotComponent.svelte +0 -4
- package/svelte-nodegui/src/components/Template.svelte +0 -10
- package/svelte-nodegui/src/components/Template.svelte.d.ts +0 -6
- package/svelte-nodegui/src/components/index.ts +0 -2
- package/svelte-nodegui/src/dom/index.ts +0 -132
- package/svelte-nodegui/src/dom/nativescript-vue-next/LICENCE +0 -21
- package/svelte-nodegui/src/dom/nativescript-vue-next/index.ts +0 -19
- package/svelte-nodegui/src/dom/nativescript-vue-next/runtime/index.ts +0 -21
- package/svelte-nodegui/src/dom/nativescript-vue-next/runtime/nodes.ts +0 -890
- package/svelte-nodegui/src/dom/nativescript-vue-next/runtime/registry.ts +0 -262
- package/svelte-nodegui/src/dom/nativescript-vue-next/runtime/runtimeHelpers.ts +0 -20
- package/svelte-nodegui/src/dom/react-nodegui/LICENSE +0 -21
- package/svelte-nodegui/src/dom/react-nodegui/src/components/AbstractComponents/RNAbstractButton.ts +0 -67
- package/svelte-nodegui/src/dom/react-nodegui/src/components/Action/RNAction.ts +0 -146
- package/svelte-nodegui/src/dom/react-nodegui/src/components/Action/index.ts +0 -37
- package/svelte-nodegui/src/dom/react-nodegui/src/components/AnimatedImage/RNAnimatedImage.ts +0 -76
- package/svelte-nodegui/src/dom/react-nodegui/src/components/AnimatedImage/index.ts +0 -45
- package/svelte-nodegui/src/dom/react-nodegui/src/components/BoxView/RNBoxView.ts +0 -99
- package/svelte-nodegui/src/dom/react-nodegui/src/components/BoxView/index.ts +0 -49
- package/svelte-nodegui/src/dom/react-nodegui/src/components/Button/RNButton.ts +0 -71
- package/svelte-nodegui/src/dom/react-nodegui/src/components/Button/index.ts +0 -49
- package/svelte-nodegui/src/dom/react-nodegui/src/components/CheckBox/RNCheckBox.ts +0 -71
- package/svelte-nodegui/src/dom/react-nodegui/src/components/CheckBox/index.ts +0 -50
- package/svelte-nodegui/src/dom/react-nodegui/src/components/ComboBox/RNComboBox.ts +0 -118
- package/svelte-nodegui/src/dom/react-nodegui/src/components/ComboBox/index.ts +0 -50
- package/svelte-nodegui/src/dom/react-nodegui/src/components/Dial/RNDial.ts +0 -69
- package/svelte-nodegui/src/dom/react-nodegui/src/components/Dial/index.ts +0 -41
- package/svelte-nodegui/src/dom/react-nodegui/src/components/GridView/GridColumn/RNGridColumn.ts +0 -95
- package/svelte-nodegui/src/dom/react-nodegui/src/components/GridView/GridColumn/index.ts +0 -49
- package/svelte-nodegui/src/dom/react-nodegui/src/components/GridView/GridRow/RNGridRow.ts +0 -141
- package/svelte-nodegui/src/dom/react-nodegui/src/components/GridView/GridRow/index.ts +0 -47
- package/svelte-nodegui/src/dom/react-nodegui/src/components/GridView/RNGridView.ts +0 -185
- package/svelte-nodegui/src/dom/react-nodegui/src/components/GridView/index.ts +0 -51
- package/svelte-nodegui/src/dom/react-nodegui/src/components/GridView/utils.ts +0 -59
- package/svelte-nodegui/src/dom/react-nodegui/src/components/Image/RNImage.ts +0 -135
- package/svelte-nodegui/src/dom/react-nodegui/src/components/Image/index.ts +0 -46
- package/svelte-nodegui/src/dom/react-nodegui/src/components/LineEdit/RNLineEdit.ts +0 -82
- package/svelte-nodegui/src/dom/react-nodegui/src/components/LineEdit/index.ts +0 -41
- package/svelte-nodegui/src/dom/react-nodegui/src/components/Menu/RNMenu.ts +0 -49
- package/svelte-nodegui/src/dom/react-nodegui/src/components/Menu/index.ts +0 -44
- package/svelte-nodegui/src/dom/react-nodegui/src/components/MenuBar/RNMenuBar.ts +0 -51
- package/svelte-nodegui/src/dom/react-nodegui/src/components/MenuBar/index.ts +0 -42
- package/svelte-nodegui/src/dom/react-nodegui/src/components/PlainTextEdit/RNPlainTextEdit.ts +0 -82
- package/svelte-nodegui/src/dom/react-nodegui/src/components/PlainTextEdit/index.ts +0 -44
- package/svelte-nodegui/src/dom/react-nodegui/src/components/ProgressBar/RNProgressBar.ts +0 -78
- package/svelte-nodegui/src/dom/react-nodegui/src/components/ProgressBar/index.ts +0 -43
- package/svelte-nodegui/src/dom/react-nodegui/src/components/RadioButton/RNRadioButton.ts +0 -50
- package/svelte-nodegui/src/dom/react-nodegui/src/components/RadioButton/index.ts +0 -43
- package/svelte-nodegui/src/dom/react-nodegui/src/components/ScrollArea/RNScrollArea.ts +0 -51
- package/svelte-nodegui/src/dom/react-nodegui/src/components/ScrollArea/index.ts +0 -44
- package/svelte-nodegui/src/dom/react-nodegui/src/components/Slider/RNSlider.ts +0 -97
- package/svelte-nodegui/src/dom/react-nodegui/src/components/Slider/index.ts +0 -46
- package/svelte-nodegui/src/dom/react-nodegui/src/components/SpinBox/RNSpinBox.ts +0 -88
- package/svelte-nodegui/src/dom/react-nodegui/src/components/SpinBox/index.ts +0 -49
- package/svelte-nodegui/src/dom/react-nodegui/src/components/Svg/RNSvg.ts +0 -67
- package/svelte-nodegui/src/dom/react-nodegui/src/components/Svg/index.ts +0 -43
- package/svelte-nodegui/src/dom/react-nodegui/src/components/SystemTrayIcon/RNSystemTrayIcon.ts +0 -141
- package/svelte-nodegui/src/dom/react-nodegui/src/components/SystemTrayIcon/index.ts +0 -43
- package/svelte-nodegui/src/dom/react-nodegui/src/components/Tab/RNTab.ts +0 -69
- package/svelte-nodegui/src/dom/react-nodegui/src/components/Tab/index.ts +0 -48
- package/svelte-nodegui/src/dom/react-nodegui/src/components/TabItem/RNTabItem.ts +0 -72
- package/svelte-nodegui/src/dom/react-nodegui/src/components/TabItem/index.ts +0 -40
- package/svelte-nodegui/src/dom/react-nodegui/src/components/Text/RNText.ts +0 -65
- package/svelte-nodegui/src/dom/react-nodegui/src/components/Text/index.ts +0 -49
- package/svelte-nodegui/src/dom/react-nodegui/src/components/View/RNView.ts +0 -306
- package/svelte-nodegui/src/dom/react-nodegui/src/components/View/index.ts +0 -44
- package/svelte-nodegui/src/dom/react-nodegui/src/components/Window/RNWindow.ts +0 -66
- package/svelte-nodegui/src/dom/react-nodegui/src/components/Window/index.ts +0 -50
- package/svelte-nodegui/src/dom/react-nodegui/src/components/config.ts +0 -95
- package/svelte-nodegui/src/dom/react-nodegui/src/index.ts +0 -52
- package/svelte-nodegui/src/dom/react-nodegui/src/reconciler/index.ts +0 -226
- package/svelte-nodegui/src/dom/react-nodegui/src/utils/decoupleFromReact.ts +0 -2
- package/svelte-nodegui/src/dom/react-nodegui/src/utils/helpers.ts +0 -14
- package/svelte-nodegui/src/dom/shared/Logger.ts +0 -16
- package/svelte-nodegui/src/dom/shared/index.ts +0 -1
- package/svelte-nodegui/src/dom/svelte/HeadElement.ts +0 -41
- package/svelte-nodegui/src/dom/svelte/RNObject.ts +0 -95
- package/svelte-nodegui/src/dom/svelte/StyleElement.ts +0 -92
- package/svelte-nodegui/src/dom/svelte/SvelteNodeGUIDocument.ts +0 -124
- package/svelte-nodegui/src/dom/svelte/TemplateElement.ts +0 -16
- package/svelte-nodegui/src/dom/svelte-elements.ts +0 -111
- package/svelte-nodegui/src/index.ts +0 -62
- package/svelte-nodegui/src/svelte-nodegui.ts +0 -159
- package/svelte-nodegui/src/transitions/bezier.ts +0 -112
- package/svelte-nodegui/src/transitions/index.ts +0 -227
- package/svelte-nodegui/tsconfig.json +0 -19
- package/svelte-nodegui/website/README.md +0 -33
- package/svelte-nodegui/website/blog/2019-05-30-welcome.md +0 -12
- package/svelte-nodegui/website/docs/api/classes/renderer.md +0 -49
- package/svelte-nodegui/website/docs/api/classes/rnaction.md +0 -608
- package/svelte-nodegui/website/docs/api/classes/rngridcolumn.md +0 -232
- package/svelte-nodegui/website/docs/api/classes/rngridrow.md +0 -247
- package/svelte-nodegui/website/docs/api/classes/rnmenu.md +0 -1337
- package/svelte-nodegui/website/docs/api/classes/rnmenubar.md +0 -1341
- package/svelte-nodegui/website/docs/api/globals.md +0 -832
- package/svelte-nodegui/website/docs/api/index.md +0 -0
- package/svelte-nodegui/website/docs/api/interfaces/_react_proxy_.reactproxycomponent.md +0 -38
- package/svelte-nodegui/website/docs/api/interfaces/abstractbuttonprops.md +0 -306
- package/svelte-nodegui/website/docs/api/interfaces/actionprops.md +0 -115
- package/svelte-nodegui/website/docs/api/interfaces/animatedimageprops.md +0 -297
- package/svelte-nodegui/website/docs/api/interfaces/boxviewprops.md +0 -245
- package/svelte-nodegui/website/docs/api/interfaces/buttonprops.md +0 -313
- package/svelte-nodegui/website/docs/api/interfaces/checkboxprops.md +0 -313
- package/svelte-nodegui/website/docs/api/interfaces/comboboxprops.md +0 -343
- package/svelte-nodegui/website/docs/api/interfaces/datawithoffset.md +0 -32
- package/svelte-nodegui/website/docs/api/interfaces/dialprops.md +0 -259
- package/svelte-nodegui/website/docs/api/interfaces/gridviewprops.md +0 -273
- package/svelte-nodegui/website/docs/api/interfaces/imageprops.md +0 -311
- package/svelte-nodegui/website/docs/api/interfaces/lineeditprops.md +0 -266
- package/svelte-nodegui/website/docs/api/interfaces/menubarprops.md +0 -245
- package/svelte-nodegui/website/docs/api/interfaces/menuprops.md +0 -245
- package/svelte-nodegui/website/docs/api/interfaces/plaintexteditprops.md +0 -259
- package/svelte-nodegui/website/docs/api/interfaces/progressbarprops.md +0 -266
- package/svelte-nodegui/website/docs/api/interfaces/radiobuttonprops.md +0 -282
- package/svelte-nodegui/website/docs/api/interfaces/scrollareaprops.md +0 -245
- package/svelte-nodegui/website/docs/api/interfaces/sliderprops.md +0 -329
- package/svelte-nodegui/website/docs/api/interfaces/spinboxprops.md +0 -273
- package/svelte-nodegui/website/docs/api/interfaces/systemtrayiconprops.md +0 -97
- package/svelte-nodegui/website/docs/api/interfaces/tabitemprops.md +0 -28
- package/svelte-nodegui/website/docs/api/interfaces/tabprops.md +0 -245
- package/svelte-nodegui/website/docs/api/interfaces/textprops.md +0 -277
- package/svelte-nodegui/website/docs/api/interfaces/viewprops.md +0 -261
- package/svelte-nodegui/website/docs/api/interfaces/windowprops.md +0 -245
- package/svelte-nodegui/website/docs/api/modules/_react_proxy_.md +0 -29
- package/svelte-nodegui/website/docs/doc1.md +0 -162
- package/svelte-nodegui/website/docs/guides/custom-nodegui-native-plugin.md +0 -6
- package/svelte-nodegui/website/docs/guides/debugging-in-vscode.md +0 -39
- package/svelte-nodegui/website/docs/guides/debugging.md +0 -59
- package/svelte-nodegui/website/docs/guides/getting-started.md +0 -141
- package/svelte-nodegui/website/docs/guides/handle-events.md +0 -188
- package/svelte-nodegui/website/docs/guides/images.md +0 -62
- package/svelte-nodegui/website/docs/guides/layout.md +0 -281
- package/svelte-nodegui/website/docs/guides/networking.md +0 -31
- package/svelte-nodegui/website/docs/guides/packaging.md +0 -32
- package/svelte-nodegui/website/docs/guides/scroll-view.md +0 -69
- package/svelte-nodegui/website/docs/guides/styling.md +0 -208
- package/svelte-nodegui/website/docs/guides/tutorial.md +0 -82
- package/svelte-nodegui/website/docs/guides/using-native-node-modules.md +0 -55
- package/svelte-nodegui/website/docs/mdx.md +0 -22
- package/svelte-nodegui/website/docs/scripts/fixdocs.js +0 -21
- package/svelte-nodegui/website/docusaurus.config.js +0 -131
- package/svelte-nodegui/website/package.json +0 -33
- package/svelte-nodegui/website/sidebars.js +0 -77
- package/svelte-nodegui/website/src/components/CodeExample.js +0 -42
- package/svelte-nodegui/website/src/components/CreateNativeApps.js +0 -46
- package/svelte-nodegui/website/src/components/Features.js +0 -62
- package/svelte-nodegui/website/src/components/Hero.js +0 -85
- package/svelte-nodegui/website/src/components/SplitView.js +0 -18
- package/svelte-nodegui/website/src/components/Talks.js +0 -68
- package/svelte-nodegui/website/src/components/Try.js +0 -83
- package/svelte-nodegui/website/src/components/common.js +0 -41
- package/svelte-nodegui/website/src/components/styles.css +0 -61
- package/svelte-nodegui/website/src/css/custom.css +0 -34
- package/svelte-nodegui/website/src/pages/index.js +0 -32
- package/svelte-nodegui/website/src/pages/styles.module.css +0 -35
- package/svelte-nodegui/website/static/CNAME +0 -1
- package/svelte-nodegui/website/static/img/box-layout-1.png +0 -0
- package/svelte-nodegui/website/static/img/box-layout-2.png +0 -0
- package/svelte-nodegui/website/static/img/code-sample.png +0 -0
- package/svelte-nodegui/website/static/img/demo.png +0 -0
- package/svelte-nodegui/website/static/img/favicon.ico +0 -0
- package/svelte-nodegui/website/static/img/flex-layout-1.png +0 -0
- package/svelte-nodegui/website/static/img/grid-layout-1.png +0 -0
- package/svelte-nodegui/website/static/img/logo-circle.png +0 -0
- package/svelte-nodegui/website/static/img/logo.png +0 -0
- package/svelte-nodegui/website/static/img/logo.svg +0 -5
- package/svelte-nodegui/website/static/img/logox200.png +0 -0
- package/svelte-nodegui/website/static/img/undraw_building_websites.svg +0 -1
- package/svelte-nodegui/website/static/img/undraw_code_review.svg +0 -1
- package/svelte-nodegui/website/static/img/undraw_docusaurus_mountain.svg +0 -170
- package/svelte-nodegui/website/static/img/undraw_docusaurus_react.svg +0 -169
- package/svelte-nodegui/website/static/img/undraw_docusaurus_tree.svg +0 -1
- package/svelte-nodegui/website/static/img/undraw_react.svg +0 -1
- package/svelte-nodegui/website/static/img/undraw_website_setup.svg +0 -1
- package/svelte-nodegui/website/static/img/undraw_windows.svg +0 -11
- package/svelte-nodegui/website/website/sidebars.js +0 -32
- package/svelte-nodegui/website/yarn.lock +0 -10533
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
QLabel,
|
|
3
|
-
QPixmap,
|
|
4
|
-
AspectRatioMode,
|
|
5
|
-
NodeWidget,
|
|
6
|
-
QSize,
|
|
7
|
-
TransformationMode,
|
|
8
|
-
} from "@nodegui/nodegui";
|
|
9
|
-
import { TextProps, setTextProps } from "../Text/RNText";
|
|
10
|
-
import { RNWidget } from "../config";
|
|
11
|
-
import { throwUnsupported, isValidUrl } from "../../utils/helpers";
|
|
12
|
-
import phin from "phin";
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* The Image component provides the ability to render images. It is based on
|
|
16
|
-
* [NodeGui's QPixmap](https://docs.nodegui.org/docs/api/generated/classes/qpixmap).
|
|
17
|
-
* ## Example
|
|
18
|
-
* ```javascript
|
|
19
|
-
* import React from "react";
|
|
20
|
-
* import { Renderer, Image, Window } from "@nodegui/react-nodegui";
|
|
21
|
-
* import { AspectRatioMode } from "@nodegui/nodegui";
|
|
22
|
-
* const App = () => {
|
|
23
|
-
* return (
|
|
24
|
-
* <Window>
|
|
25
|
-
* <Image
|
|
26
|
-
* aspectRatioMode={AspectRatioMode.KeepAspectRatio}
|
|
27
|
-
* size={{ height: 200, width: 150 }}
|
|
28
|
-
* src="https://place-hold.it/200x150"
|
|
29
|
-
* ></Image>
|
|
30
|
-
* </Window>
|
|
31
|
-
* );
|
|
32
|
-
* };
|
|
33
|
-
* Renderer.render(<App />);
|
|
34
|
-
* ```
|
|
35
|
-
*/
|
|
36
|
-
export interface ImageProps extends TextProps {
|
|
37
|
-
src?: string;
|
|
38
|
-
aspectRatioMode?: AspectRatioMode;
|
|
39
|
-
transformationMode?: TransformationMode;
|
|
40
|
-
buffer?: Buffer;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
const setImageProps = (
|
|
44
|
-
widget: RNImage,
|
|
45
|
-
newProps: ImageProps,
|
|
46
|
-
oldProps: ImageProps
|
|
47
|
-
) => {
|
|
48
|
-
const setter: ImageProps = {
|
|
49
|
-
set src(imageUrlOrPath: string) {
|
|
50
|
-
if (!imageUrlOrPath) {
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
getLoadedPixmap(imageUrlOrPath)
|
|
54
|
-
.then((pixmap) => widget.setPixmap(pixmap))
|
|
55
|
-
.catch(console.warn);
|
|
56
|
-
},
|
|
57
|
-
set buffer(imageBuffer: Buffer) {
|
|
58
|
-
const pixMap = new QPixmap();
|
|
59
|
-
pixMap.loadFromData(imageBuffer);
|
|
60
|
-
widget.setPixmap(pixMap);
|
|
61
|
-
},
|
|
62
|
-
set aspectRatioMode(mode: AspectRatioMode) {
|
|
63
|
-
widget.setAspectRatioMode(mode);
|
|
64
|
-
},
|
|
65
|
-
set transformationMode(mode: TransformationMode) {
|
|
66
|
-
widget.setTransformationMode(mode);
|
|
67
|
-
},
|
|
68
|
-
};
|
|
69
|
-
Object.assign(setter, newProps);
|
|
70
|
-
setTextProps(widget, newProps, oldProps);
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* @ignore
|
|
75
|
-
*/
|
|
76
|
-
export class RNImage extends QLabel implements RNWidget {
|
|
77
|
-
setProps(newProps: ImageProps, oldProps: ImageProps): void {
|
|
78
|
-
setImageProps(this, newProps, oldProps);
|
|
79
|
-
}
|
|
80
|
-
appendInitialChild(child: NodeWidget<any>): void {
|
|
81
|
-
throwUnsupported(this);
|
|
82
|
-
}
|
|
83
|
-
appendChild(child: NodeWidget<any>): void {
|
|
84
|
-
throwUnsupported(this);
|
|
85
|
-
}
|
|
86
|
-
insertBefore(child: NodeWidget<any>, beforeChild: NodeWidget<any>): void {
|
|
87
|
-
throwUnsupported(this);
|
|
88
|
-
}
|
|
89
|
-
removeChild(child: NodeWidget<any>): void {
|
|
90
|
-
throwUnsupported(this);
|
|
91
|
-
}
|
|
92
|
-
static tagName = "image";
|
|
93
|
-
originalPixmap?: QPixmap;
|
|
94
|
-
aspectRatioMode?: AspectRatioMode;
|
|
95
|
-
transformationMode?: TransformationMode;
|
|
96
|
-
setPixmap = (pixmap: QPixmap) => {
|
|
97
|
-
// react:✓
|
|
98
|
-
super.setPixmap(pixmap);
|
|
99
|
-
this.originalPixmap = pixmap;
|
|
100
|
-
};
|
|
101
|
-
setAspectRatioMode(mode: AspectRatioMode) {
|
|
102
|
-
// react:✓ TODO://getter
|
|
103
|
-
this.aspectRatioMode = mode;
|
|
104
|
-
this.scalePixmap(this.size());
|
|
105
|
-
}
|
|
106
|
-
setTransformationMode(mode: TransformationMode) {
|
|
107
|
-
// react:✓ TODO://getter
|
|
108
|
-
this.transformationMode = mode;
|
|
109
|
-
this.scalePixmap(this.size());
|
|
110
|
-
}
|
|
111
|
-
scalePixmap(size: QSize) {
|
|
112
|
-
if (this.originalPixmap) {
|
|
113
|
-
return super.setPixmap(
|
|
114
|
-
this.originalPixmap.scaled(
|
|
115
|
-
size.width(),
|
|
116
|
-
size.height(),
|
|
117
|
-
this.aspectRatioMode,
|
|
118
|
-
this.transformationMode
|
|
119
|
-
)
|
|
120
|
-
);
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
async function getLoadedPixmap(imageUrlOrPath: string): Promise<QPixmap> {
|
|
126
|
-
const pixMap = new QPixmap();
|
|
127
|
-
if (isValidUrl(imageUrlOrPath)) {
|
|
128
|
-
const res = await phin(imageUrlOrPath);
|
|
129
|
-
const imageBuffer = Buffer.from(res.body);
|
|
130
|
-
pixMap.loadFromData(imageBuffer);
|
|
131
|
-
} else {
|
|
132
|
-
pixMap.load(imageUrlOrPath);
|
|
133
|
-
}
|
|
134
|
-
return pixMap;
|
|
135
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import type { Fiber } from "../../utils/decoupleFromReact";
|
|
2
|
-
import { registerComponent, ComponentConfig } from "../config";
|
|
3
|
-
import { RNImage, ImageProps } from "./RNImage";
|
|
4
|
-
import { AppContainer } from "../../reconciler";
|
|
5
|
-
import { WidgetEventTypes } from "@nodegui/nodegui";
|
|
6
|
-
class ImageConfig extends ComponentConfig {
|
|
7
|
-
tagName = RNImage.tagName;
|
|
8
|
-
shouldSetTextContent(nextProps: ImageProps): boolean {
|
|
9
|
-
return true;
|
|
10
|
-
}
|
|
11
|
-
createInstance(
|
|
12
|
-
newProps: ImageProps,
|
|
13
|
-
rootInstance: AppContainer,
|
|
14
|
-
context: any,
|
|
15
|
-
workInProgress: Fiber
|
|
16
|
-
): RNImage {
|
|
17
|
-
const widget = new RNImage();
|
|
18
|
-
widget.setProperty("scaledContents", true);
|
|
19
|
-
widget.setProps(newProps, {});
|
|
20
|
-
widget.addEventListener(WidgetEventTypes.Resize, () => {
|
|
21
|
-
widget.scalePixmap(widget.size());
|
|
22
|
-
});
|
|
23
|
-
return widget;
|
|
24
|
-
}
|
|
25
|
-
commitMount(
|
|
26
|
-
instance: RNImage,
|
|
27
|
-
newProps: ImageProps,
|
|
28
|
-
internalInstanceHandle: any
|
|
29
|
-
): void {
|
|
30
|
-
if (newProps.visible !== false) {
|
|
31
|
-
instance.show();
|
|
32
|
-
}
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
commitUpdate(
|
|
36
|
-
instance: RNImage,
|
|
37
|
-
updatePayload: any,
|
|
38
|
-
oldProps: ImageProps,
|
|
39
|
-
newProps: ImageProps,
|
|
40
|
-
finishedWork: Fiber
|
|
41
|
-
): void {
|
|
42
|
-
instance.setProps(newProps, oldProps);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export const Image = registerComponent<ImageProps>(new ImageConfig());
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
QLineEdit,
|
|
3
|
-
EchoMode,
|
|
4
|
-
NodeWidget,
|
|
5
|
-
QLineEditSignals
|
|
6
|
-
} from "@nodegui/nodegui";
|
|
7
|
-
import { ViewProps, setViewProps } from "../View/RNView";
|
|
8
|
-
import { RNWidget } from "../config";
|
|
9
|
-
import { throwUnsupported } from "../../utils/helpers";
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* The LineEdit component provides ability to add and manipulate native editable text field widgets. It is based on
|
|
13
|
-
* [NodeGui's QLineEdit](https://docs.nodegui.org/docs/api/generated/classes/qlineedit).
|
|
14
|
-
* ## Example
|
|
15
|
-
* ```javascript
|
|
16
|
-
* import React from "react";
|
|
17
|
-
* import { Renderer, LineEdit, Window } from "@nodegui/react-nodegui";
|
|
18
|
-
* const App = () => {
|
|
19
|
-
* const handleTextChanged = textValue => {
|
|
20
|
-
* console.log(textValue);
|
|
21
|
-
* };
|
|
22
|
-
* return (
|
|
23
|
-
* <Window>
|
|
24
|
-
* <LineEdit on={{ textChanged: handleTextChanged }} />
|
|
25
|
-
* </Window>
|
|
26
|
-
* );
|
|
27
|
-
* };
|
|
28
|
-
* Renderer.render(<App />);
|
|
29
|
-
*
|
|
30
|
-
* ```
|
|
31
|
-
*/
|
|
32
|
-
export interface LineEditProps extends ViewProps<QLineEditSignals> {
|
|
33
|
-
text?: string;
|
|
34
|
-
placeholderText?: string;
|
|
35
|
-
readOnly?: boolean;
|
|
36
|
-
echoMode?: EchoMode;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
const setLineEditProps = (
|
|
40
|
-
widget: RNLineEdit,
|
|
41
|
-
newProps: LineEditProps,
|
|
42
|
-
oldProps: LineEditProps
|
|
43
|
-
) => {
|
|
44
|
-
const setter: LineEditProps = {
|
|
45
|
-
set text(text: string) {
|
|
46
|
-
text ? widget.setText(text) : widget.clear();
|
|
47
|
-
},
|
|
48
|
-
set placeholderText(text: string) {
|
|
49
|
-
widget.setPlaceholderText(text);
|
|
50
|
-
},
|
|
51
|
-
set readOnly(isReadOnly: boolean) {
|
|
52
|
-
widget.setReadOnly(isReadOnly);
|
|
53
|
-
},
|
|
54
|
-
set echoMode(mode: EchoMode) {
|
|
55
|
-
widget.setEchoMode(mode);
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
Object.assign(setter, newProps);
|
|
59
|
-
setViewProps(widget, newProps, oldProps);
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* @ignore
|
|
64
|
-
*/
|
|
65
|
-
export class RNLineEdit extends QLineEdit implements RNWidget {
|
|
66
|
-
setProps(newProps: LineEditProps, oldProps: LineEditProps): void {
|
|
67
|
-
setLineEditProps(this, newProps, oldProps);
|
|
68
|
-
}
|
|
69
|
-
appendInitialChild(child: NodeWidget<any>): void {
|
|
70
|
-
throwUnsupported(this);
|
|
71
|
-
}
|
|
72
|
-
appendChild(child: NodeWidget<any>): void {
|
|
73
|
-
throwUnsupported(this);
|
|
74
|
-
}
|
|
75
|
-
insertBefore(child: NodeWidget<any>, beforeChild: NodeWidget<any>): void {
|
|
76
|
-
throwUnsupported(this);
|
|
77
|
-
}
|
|
78
|
-
removeChild(child: NodeWidget<any>): void {
|
|
79
|
-
throwUnsupported(this);
|
|
80
|
-
}
|
|
81
|
-
static tagName = "linedit";
|
|
82
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import type { Fiber } from "../../utils/decoupleFromReact";
|
|
2
|
-
import { registerComponent, ComponentConfig } from "../config";
|
|
3
|
-
import { LineEditProps, RNLineEdit } from "./RNLineEdit";
|
|
4
|
-
import { AppContainer } from "../../reconciler";
|
|
5
|
-
class LineEditConfig extends ComponentConfig {
|
|
6
|
-
tagName = RNLineEdit.tagName;
|
|
7
|
-
shouldSetTextContent(nextProps: LineEditProps): boolean {
|
|
8
|
-
return true;
|
|
9
|
-
}
|
|
10
|
-
createInstance(
|
|
11
|
-
newProps: LineEditProps,
|
|
12
|
-
rootInstance: AppContainer,
|
|
13
|
-
context: any,
|
|
14
|
-
workInProgress: Fiber
|
|
15
|
-
): RNLineEdit {
|
|
16
|
-
const widget = new RNLineEdit();
|
|
17
|
-
widget.setProps(newProps, {});
|
|
18
|
-
return widget;
|
|
19
|
-
}
|
|
20
|
-
commitMount(
|
|
21
|
-
instance: RNLineEdit,
|
|
22
|
-
newProps: LineEditProps,
|
|
23
|
-
internalInstanceHandle: any
|
|
24
|
-
): void {
|
|
25
|
-
if (newProps.visible !== false) {
|
|
26
|
-
instance.show();
|
|
27
|
-
}
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
commitUpdate(
|
|
31
|
-
instance: RNLineEdit,
|
|
32
|
-
updatePayload: any,
|
|
33
|
-
oldProps: LineEditProps,
|
|
34
|
-
newProps: LineEditProps,
|
|
35
|
-
finishedWork: Fiber
|
|
36
|
-
): void {
|
|
37
|
-
instance.setProps(newProps, oldProps);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export const LineEdit = registerComponent<LineEditProps>(new LineEditConfig());
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { QMenu, QMenuSignals, Component, NodeWidget } from "@nodegui/nodegui";
|
|
2
|
-
import { RNWidget } from "../config";
|
|
3
|
-
import { throwUnsupported } from "../../utils/helpers";
|
|
4
|
-
import { RNAction } from "../Action/RNAction";
|
|
5
|
-
import { setViewProps, ViewProps } from "../View/RNView";
|
|
6
|
-
|
|
7
|
-
export interface MenuProps extends ViewProps<QMenuSignals> {
|
|
8
|
-
title?: string;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
const setMenuProps = (
|
|
12
|
-
widget: RNMenu,
|
|
13
|
-
newProps: MenuProps,
|
|
14
|
-
oldProps: MenuProps
|
|
15
|
-
) => {
|
|
16
|
-
const setter: MenuProps = {
|
|
17
|
-
set title(title: string) {
|
|
18
|
-
widget.setTitle(title);
|
|
19
|
-
},
|
|
20
|
-
};
|
|
21
|
-
Object.assign(setter, newProps);
|
|
22
|
-
setViewProps(widget, newProps, oldProps);
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export class RNMenu extends QMenu implements RNWidget {
|
|
26
|
-
setProps(newProps: MenuProps, oldProps: MenuProps): void {
|
|
27
|
-
setMenuProps(this, newProps, oldProps);
|
|
28
|
-
}
|
|
29
|
-
appendInitialChild(child: Component): void {
|
|
30
|
-
this.appendChild(child);
|
|
31
|
-
}
|
|
32
|
-
appendChild(child: Component): void {
|
|
33
|
-
if (!(child instanceof RNAction)) {
|
|
34
|
-
console.warn("Menu only supports Action as its children");
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
this.addAction(child);
|
|
39
|
-
}
|
|
40
|
-
insertBefore(child: Component, beforeChild: Component): void {
|
|
41
|
-
throwUnsupported(this);
|
|
42
|
-
}
|
|
43
|
-
removeChild(child: Component): void {
|
|
44
|
-
if (child instanceof RNAction) {
|
|
45
|
-
this.removeAction(child);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
static tagName = "menu";
|
|
49
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import type { Fiber } from "../../utils/decoupleFromReact";
|
|
2
|
-
import { registerComponent, ComponentConfig } from "../config";
|
|
3
|
-
import { RNMenu, MenuProps } from "./RNMenu";
|
|
4
|
-
import { AppContainer } from "../../reconciler";
|
|
5
|
-
class MenuConfig extends ComponentConfig {
|
|
6
|
-
|
|
7
|
-
tagName = RNMenu.tagName;
|
|
8
|
-
shouldSetTextContent(nextProps: MenuProps): boolean {
|
|
9
|
-
return false;
|
|
10
|
-
}
|
|
11
|
-
createInstance(
|
|
12
|
-
newProps: MenuProps,
|
|
13
|
-
rootInstance: AppContainer,
|
|
14
|
-
context: any,
|
|
15
|
-
workInProgress: Fiber
|
|
16
|
-
): RNMenu {
|
|
17
|
-
const widget = new RNMenu();
|
|
18
|
-
widget.setProps(newProps, {});
|
|
19
|
-
return widget;
|
|
20
|
-
}
|
|
21
|
-
commitMount(
|
|
22
|
-
instance: RNMenu,
|
|
23
|
-
newProps: MenuProps,
|
|
24
|
-
internalInstanceHandle: any
|
|
25
|
-
): void {
|
|
26
|
-
if (newProps.visible !== false) {
|
|
27
|
-
instance.show();
|
|
28
|
-
}
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
commitUpdate(
|
|
32
|
-
instance: RNMenu,
|
|
33
|
-
updatePayload: any,
|
|
34
|
-
oldProps: MenuProps,
|
|
35
|
-
newProps: MenuProps,
|
|
36
|
-
finishedWork: Fiber
|
|
37
|
-
): void {
|
|
38
|
-
instance.setProps(newProps, oldProps);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export const Menu = registerComponent<MenuProps>(
|
|
43
|
-
new MenuConfig()
|
|
44
|
-
);
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { NodeWidget, QMenu, QMenuBar, QMenuBarSignals } from "@nodegui/nodegui";
|
|
2
|
-
import { ViewProps, setViewProps } from "../View/RNView";
|
|
3
|
-
import { RNWidget } from "../config";
|
|
4
|
-
import { throwUnsupported } from "../../utils/helpers";
|
|
5
|
-
|
|
6
|
-
export interface MenuBarProps extends ViewProps<QMenuBarSignals> {
|
|
7
|
-
nativeMenuBar?: boolean;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
const setMenuBarProps = (
|
|
11
|
-
widget: RNMenuBar,
|
|
12
|
-
newProps: MenuBarProps,
|
|
13
|
-
oldProps: MenuBarProps
|
|
14
|
-
) => {
|
|
15
|
-
const setter: MenuBarProps = {
|
|
16
|
-
set nativeMenuBar(shouldBeNative: boolean) {
|
|
17
|
-
widget.setNativeMenuBar(shouldBeNative);
|
|
18
|
-
},
|
|
19
|
-
};
|
|
20
|
-
Object.assign(setter, newProps);
|
|
21
|
-
setViewProps(widget, newProps, oldProps);
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export class RNMenuBar extends QMenuBar implements RNWidget {
|
|
25
|
-
setProps(newProps: MenuBarProps, oldProps: MenuBarProps): void {
|
|
26
|
-
setMenuBarProps(this, newProps, oldProps);
|
|
27
|
-
}
|
|
28
|
-
appendInitialChild(child: QMenu): void {
|
|
29
|
-
if (child instanceof QMenu) {
|
|
30
|
-
this.addMenu(child);
|
|
31
|
-
} else {
|
|
32
|
-
console.warn("MenuBar only supports Menu as its children");
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
appendChild(child: QMenu): void {
|
|
36
|
-
this.appendInitialChild(child);
|
|
37
|
-
}
|
|
38
|
-
insertBefore(child: NodeWidget<any>, beforeChild: NodeWidget<any>): void {
|
|
39
|
-
console.warn(
|
|
40
|
-
"Updating menubar is not yet supported. Please help by raising a PR"
|
|
41
|
-
);
|
|
42
|
-
throwUnsupported(this);
|
|
43
|
-
}
|
|
44
|
-
removeChild(child: NodeWidget<any>): void {
|
|
45
|
-
console.warn(
|
|
46
|
-
"Updating menubar is not yet supported. Please help by raising a PR"
|
|
47
|
-
);
|
|
48
|
-
throwUnsupported(this);
|
|
49
|
-
}
|
|
50
|
-
static tagName = "menubar";
|
|
51
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import type { Fiber } from "../../utils/decoupleFromReact";
|
|
2
|
-
import { registerComponent, ComponentConfig } from "../config";
|
|
3
|
-
import { RNMenuBar, MenuBarProps } from "./RNMenuBar";
|
|
4
|
-
import { AppContainer } from "../../reconciler";
|
|
5
|
-
|
|
6
|
-
class MenuBarConfig extends ComponentConfig {
|
|
7
|
-
tagName = RNMenuBar.tagName;
|
|
8
|
-
shouldSetTextContent(nextProps: MenuBarProps): boolean {
|
|
9
|
-
return false;
|
|
10
|
-
}
|
|
11
|
-
createInstance(
|
|
12
|
-
newProps: MenuBarProps,
|
|
13
|
-
rootInstance: AppContainer,
|
|
14
|
-
context: any,
|
|
15
|
-
workInProgress: Fiber
|
|
16
|
-
): RNMenuBar {
|
|
17
|
-
const widget = new RNMenuBar();
|
|
18
|
-
widget.setProps(newProps, {});
|
|
19
|
-
return widget;
|
|
20
|
-
}
|
|
21
|
-
commitMount(
|
|
22
|
-
instance: RNMenuBar,
|
|
23
|
-
newProps: MenuBarProps,
|
|
24
|
-
internalInstanceHandle: any
|
|
25
|
-
): void {
|
|
26
|
-
if (newProps.visible !== false) {
|
|
27
|
-
instance.show();
|
|
28
|
-
}
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
commitUpdate(
|
|
32
|
-
instance: RNMenuBar,
|
|
33
|
-
updatePayload: any,
|
|
34
|
-
oldProps: MenuBarProps,
|
|
35
|
-
newProps: MenuBarProps,
|
|
36
|
-
finishedWork: Fiber
|
|
37
|
-
): void {
|
|
38
|
-
instance.setProps(newProps, oldProps);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export const MenuBar = registerComponent<MenuBarProps>(new MenuBarConfig());
|
package/svelte-nodegui/src/dom/react-nodegui/src/components/PlainTextEdit/RNPlainTextEdit.ts
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
QPlainTextEdit,
|
|
3
|
-
NodeWidget,
|
|
4
|
-
QPlainTextEditSignals
|
|
5
|
-
} from "@nodegui/nodegui";
|
|
6
|
-
import { ViewProps, setViewProps } from "../View/RNView";
|
|
7
|
-
import { RNWidget } from "../config";
|
|
8
|
-
import { throwUnsupported } from "../../utils/helpers";
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* The PlainTextEdit component provides ability to add and manipulate native editable text field widgets. It is based on
|
|
12
|
-
* [NodeGui's QPlainTextEdit](https://docs.nodegui.org/docs/api/generated/classes/qplaintextedit/).
|
|
13
|
-
* ## Example
|
|
14
|
-
* ```javascript
|
|
15
|
-
* import React from "react";
|
|
16
|
-
* import { Renderer, PlainTextEdit, Window } from "@nodegui/react-nodegui";
|
|
17
|
-
*
|
|
18
|
-
* const plainTextRef = React.createRef();
|
|
19
|
-
* const App = () => {
|
|
20
|
-
* React.useEffect(() => {
|
|
21
|
-
* plainTextRef.current.addEventListener("textChanged", () =>
|
|
22
|
-
* console.log(plainTextRef.current.toPlainText())
|
|
23
|
-
* );
|
|
24
|
-
* });
|
|
25
|
-
* return (
|
|
26
|
-
* <Window>
|
|
27
|
-
* <PlainTextEdit ref={plainTextRef} />
|
|
28
|
-
* </Window>
|
|
29
|
-
* );
|
|
30
|
-
* };
|
|
31
|
-
* Renderer.render(<App />);
|
|
32
|
-
*
|
|
33
|
-
* ```
|
|
34
|
-
*/
|
|
35
|
-
|
|
36
|
-
export interface PlainTextEditProps extends ViewProps<QPlainTextEditSignals> {
|
|
37
|
-
text?: string;
|
|
38
|
-
readOnly?: boolean;
|
|
39
|
-
placeholderText?: string;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
const setPlainTextEditProps = (
|
|
43
|
-
widget: RNPlainTextEdit,
|
|
44
|
-
newProps: PlainTextEditProps,
|
|
45
|
-
oldProps: PlainTextEditProps
|
|
46
|
-
) => {
|
|
47
|
-
const setter: PlainTextEditProps = {
|
|
48
|
-
set text(text: string) {
|
|
49
|
-
text ? widget.setPlainText(text) : widget.clear();
|
|
50
|
-
},
|
|
51
|
-
set readOnly(isReadOnly: boolean) {
|
|
52
|
-
widget.setReadOnly(isReadOnly);
|
|
53
|
-
},
|
|
54
|
-
set placeholderText(text: string) {
|
|
55
|
-
widget.setPlaceholderText(text);
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
Object.assign(setter, newProps);
|
|
59
|
-
setViewProps(widget, newProps, oldProps);
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* @ignore
|
|
64
|
-
*/
|
|
65
|
-
export class RNPlainTextEdit extends QPlainTextEdit implements RNWidget {
|
|
66
|
-
setProps(newProps: PlainTextEditProps, oldProps: PlainTextEditProps): void {
|
|
67
|
-
setPlainTextEditProps(this, newProps, oldProps);
|
|
68
|
-
}
|
|
69
|
-
appendInitialChild(child: NodeWidget<any>): void {
|
|
70
|
-
throwUnsupported(this);
|
|
71
|
-
}
|
|
72
|
-
appendChild(child: NodeWidget<any>): void {
|
|
73
|
-
throwUnsupported(this);
|
|
74
|
-
}
|
|
75
|
-
insertBefore(child: NodeWidget<any>, beforeChild: NodeWidget<any>): void {
|
|
76
|
-
throwUnsupported(this);
|
|
77
|
-
}
|
|
78
|
-
removeChild(child: NodeWidget<any>): void {
|
|
79
|
-
throwUnsupported(this);
|
|
80
|
-
}
|
|
81
|
-
static tagName = "plaintextedit";
|
|
82
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { registerComponent, ComponentConfig } from "../config";
|
|
2
|
-
import type { Fiber } from "../../utils/decoupleFromReact";
|
|
3
|
-
import { RNPlainTextEdit, PlainTextEditProps } from "./RNPlainTextEdit";
|
|
4
|
-
import { AppContainer } from "../../reconciler";
|
|
5
|
-
|
|
6
|
-
class PlainTextEditConfig extends ComponentConfig {
|
|
7
|
-
tagName = RNPlainTextEdit.tagName;
|
|
8
|
-
shouldSetTextContent(nextProps: PlainTextEditProps): boolean {
|
|
9
|
-
return true;
|
|
10
|
-
}
|
|
11
|
-
createInstance(
|
|
12
|
-
newProps: PlainTextEditProps,
|
|
13
|
-
rootInstance: AppContainer,
|
|
14
|
-
context: any,
|
|
15
|
-
workInProgress: Fiber
|
|
16
|
-
): RNPlainTextEdit {
|
|
17
|
-
const widget = new RNPlainTextEdit();
|
|
18
|
-
widget.setProps(newProps, {});
|
|
19
|
-
return widget;
|
|
20
|
-
}
|
|
21
|
-
commitMount(
|
|
22
|
-
instance: RNPlainTextEdit,
|
|
23
|
-
newProps: PlainTextEditProps,
|
|
24
|
-
internalInstanceHandle: any
|
|
25
|
-
): void {
|
|
26
|
-
if (newProps.visible !== false) {
|
|
27
|
-
instance.show();
|
|
28
|
-
}
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
commitUpdate(
|
|
32
|
-
instance: RNPlainTextEdit,
|
|
33
|
-
updatePayload: any,
|
|
34
|
-
oldProps: PlainTextEditProps,
|
|
35
|
-
newProps: PlainTextEditProps,
|
|
36
|
-
finishedWork: Fiber
|
|
37
|
-
): void {
|
|
38
|
-
instance.setProps(newProps, oldProps);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export const PlainTextEdit = registerComponent<PlainTextEditProps>(
|
|
43
|
-
new PlainTextEditConfig()
|
|
44
|
-
);
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
QProgressBar,
|
|
3
|
-
Orientation,
|
|
4
|
-
NodeWidget,
|
|
5
|
-
QProgressBarSignals
|
|
6
|
-
} from "@nodegui/nodegui";
|
|
7
|
-
import { ViewProps, setViewProps } from "../View/RNView";
|
|
8
|
-
import { RNWidget } from "../config";
|
|
9
|
-
import { throwUnsupported } from "../../utils/helpers";
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* The ProgressBar component provides ability to add and manipulate native progress bar widgets. It is based on
|
|
13
|
-
* [NodeGui's QProgressBar](https://docs.nodegui.org/docs/api/generated/classes/qprogressbar/).
|
|
14
|
-
* ## Example
|
|
15
|
-
* ```javascript
|
|
16
|
-
* import React from "react";
|
|
17
|
-
* import { Renderer, ProgressBar, Window } from "@nodegui/react-nodegui";
|
|
18
|
-
* const App = () => {
|
|
19
|
-
* return (
|
|
20
|
-
* <Window>
|
|
21
|
-
* <ProgressBar value={45} />
|
|
22
|
-
* </Window>
|
|
23
|
-
* );
|
|
24
|
-
* };
|
|
25
|
-
* Renderer.render(<App />);
|
|
26
|
-
* ```
|
|
27
|
-
*/
|
|
28
|
-
export interface ProgressBarProps extends ViewProps<QProgressBarSignals> {
|
|
29
|
-
value?: number;
|
|
30
|
-
minimum?: number;
|
|
31
|
-
maximum?: number;
|
|
32
|
-
orientation?: Orientation;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
const setProgressBarProps = (
|
|
36
|
-
widget: RNProgressBar,
|
|
37
|
-
newProps: ProgressBarProps,
|
|
38
|
-
oldProps: ProgressBarProps
|
|
39
|
-
) => {
|
|
40
|
-
const setter: ProgressBarProps = {
|
|
41
|
-
set value(val: number) {
|
|
42
|
-
widget.setValue(val);
|
|
43
|
-
},
|
|
44
|
-
set minimum(min: number) {
|
|
45
|
-
widget.setMinimum(min);
|
|
46
|
-
},
|
|
47
|
-
set maximum(max: number) {
|
|
48
|
-
widget.setMaximum(max);
|
|
49
|
-
},
|
|
50
|
-
set orientation(orientation: Orientation) {
|
|
51
|
-
widget.setOrientation(orientation);
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
Object.assign(setter, newProps);
|
|
55
|
-
setViewProps(widget, newProps, oldProps);
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* @ignore
|
|
60
|
-
*/
|
|
61
|
-
export class RNProgressBar extends QProgressBar implements RNWidget {
|
|
62
|
-
setProps(newProps: ProgressBarProps, oldProps: ProgressBarProps): void {
|
|
63
|
-
setProgressBarProps(this, newProps, oldProps);
|
|
64
|
-
}
|
|
65
|
-
appendInitialChild(child: NodeWidget<any>): void {
|
|
66
|
-
throwUnsupported(this);
|
|
67
|
-
}
|
|
68
|
-
appendChild(child: NodeWidget<any>): void {
|
|
69
|
-
throwUnsupported(this);
|
|
70
|
-
}
|
|
71
|
-
insertBefore(child: NodeWidget<any>, beforeChild: NodeWidget<any>): void {
|
|
72
|
-
throwUnsupported(this);
|
|
73
|
-
}
|
|
74
|
-
removeChild(child: NodeWidget<any>): void {
|
|
75
|
-
throwUnsupported(this);
|
|
76
|
-
}
|
|
77
|
-
static tagName = "progressbar";
|
|
78
|
-
}
|