@lukaskj/xmonkey 2.2.7 → 2.2.10
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/dist/build.js +18 -40
- package/dist/esm/examples/whatsapp-theme/index.d.ts +7 -0
- package/dist/esm/examples/whatsapp-theme/index.js +58 -0
- package/dist/esm/examples/youtube-adblocker.d.ts +4 -0
- package/dist/esm/examples/youtube-adblocker.js +52 -0
- package/dist/esm/src/build.d.ts +2 -0
- package/dist/esm/src/build.js +10 -0
- package/dist/esm/src/console-script/console-script.decorator.js +10 -0
- package/dist/esm/src/console-script/console-script.interface.js +4 -0
- package/dist/esm/src/console-script/index.js +3 -0
- package/dist/esm/src/esbuild/build.js +29 -0
- package/dist/esm/src/esbuild/plugins/xmonkey-output-stats-plugin.js +18 -0
- package/dist/esm/src/esbuild/plugins/xmonkey-strip-metadata-plugin.js +77 -0
- package/dist/esm/src/esbuild/plugins/xmonkey-styles-plugin.js +36 -0
- package/dist/esm/src/hooks/index.js +30 -0
- package/dist/esm/src/index.js +1 -0
- package/dist/esm/src/types.js +2 -0
- package/dist/esm/src/ui-script/index.js +3 -0
- package/dist/esm/src/ui-script/ui-script.decorator.js +25 -0
- package/dist/esm/src/ui-script/ui-script.interface.js +2 -0
- package/dist/esm/src/utils/get-storage-key-id-from-string.js +4 -0
- package/dist/esm/src/utils/is-null-or-undefined.js +5 -0
- package/dist/esm/src/utils/sleep.js +4 -0
- package/dist/esm/src/x-monkey-window-component.js +17 -0
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -0
- package/dist/styles/_colors.scss +4 -1
- package/dist/styles/_xmonkey-wrapper.scss +15 -13
- package/package.json +37 -38
- package/dist/build.d.ts +0 -1
- package/dist/console-script/console-script.decorator.js +0 -9
- package/dist/console-script/console-script.interface.js +0 -3
- package/dist/console-script/index.js +0 -2
- package/dist/esbuild/build.js +0 -28
- package/dist/esbuild/plugins/xmonkey-output-stats-plugin.js +0 -17
- package/dist/esbuild/plugins/xmonkey-strip-metadata-plugin.js +0 -76
- package/dist/esbuild/plugins/xmonkey-styles-plugin.js +0 -34
- package/dist/hooks/index.js +0 -29
- package/dist/index.js +0 -0
- package/dist/types.js +0 -1
- package/dist/ui-script/index.js +0 -2
- package/dist/ui-script/ui-script.decorator.js +0 -19
- package/dist/ui-script/ui-script.interface.js +0 -1
- package/dist/utils/get-storage-key-id-from-string.js +0 -3
- package/dist/utils/is-null-or-undefined.js +0 -4
- package/dist/utils/sleep.js +0 -3
- package/dist/x-monkey-window-component.js +0 -16
- /package/dist/{console-script → esm/src/console-script}/console-script.decorator.d.ts +0 -0
- /package/dist/{console-script → esm/src/console-script}/console-script.interface.d.ts +0 -0
- /package/dist/{console-script → esm/src/console-script}/index.d.ts +0 -0
- /package/dist/{esbuild → esm/src/esbuild}/build.d.ts +0 -0
- /package/dist/{esbuild → esm/src/esbuild}/plugins/xmonkey-output-stats-plugin.d.ts +0 -0
- /package/dist/{esbuild → esm/src/esbuild}/plugins/xmonkey-strip-metadata-plugin.d.ts +0 -0
- /package/dist/{esbuild → esm/src/esbuild}/plugins/xmonkey-styles-plugin.d.ts +0 -0
- /package/dist/{hooks → esm/src/hooks}/index.d.ts +0 -0
- /package/dist/{index.d.ts → esm/src/index.d.ts} +0 -0
- /package/dist/{types.d.ts → esm/src/types.d.ts} +0 -0
- /package/dist/{ui-script → esm/src/ui-script}/index.d.ts +0 -0
- /package/dist/{ui-script → esm/src/ui-script}/ui-script.decorator.d.ts +0 -0
- /package/dist/{ui-script → esm/src/ui-script}/ui-script.interface.d.ts +0 -0
- /package/dist/{utils → esm/src/utils}/get-storage-key-id-from-string.d.ts +0 -0
- /package/dist/{utils → esm/src/utils}/is-null-or-undefined.d.ts +0 -0
- /package/dist/{utils → esm/src/utils}/sleep.d.ts +0 -0
- /package/dist/{x-monkey-window-component.d.ts → esm/src/x-monkey-window-component.d.ts} +0 -0
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { h, render } from "preact";
|
|
2
|
-
import { XMonkeyWindowComponent } from "../x-monkey-window-component.js";
|
|
3
|
-
export function UiScript(_metadata) {
|
|
4
|
-
return function (_target) {
|
|
5
|
-
const scriptObject = new _target();
|
|
6
|
-
const rootComponent = xMonkeyWrapperElement();
|
|
7
|
-
render(h(XMonkeyWindowComponent, { title: scriptObject.title ?? "" }, scriptObject.render()), rootComponent);
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
function xMonkeyWrapperElement() {
|
|
11
|
-
const ID = "__xmwr";
|
|
12
|
-
let div = document.getElementById(ID);
|
|
13
|
-
if (div)
|
|
14
|
-
return div;
|
|
15
|
-
div = document.createElement("div");
|
|
16
|
-
div.id = ID;
|
|
17
|
-
document.body.appendChild(div);
|
|
18
|
-
return div;
|
|
19
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/utils/sleep.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "preact/jsx-runtime";
|
|
2
|
-
import { useSessionStorage } from "./hooks";
|
|
3
|
-
import { useMemo } from "preact/hooks";
|
|
4
|
-
import { getStorageKeyIdFromString } from "./utils/get-storage-key-id-from-string";
|
|
5
|
-
export function XMonkeyWindowComponent(props) {
|
|
6
|
-
const storageKey = useMemo(() => getStorageKeyIdFromString(props.title), [props.title]);
|
|
7
|
-
const [minimized, setMinimized] = useSessionStorage(storageKey, false);
|
|
8
|
-
function toggleMinimize() {
|
|
9
|
-
setMinimized(!minimized);
|
|
10
|
-
}
|
|
11
|
-
return (_jsxs("div", { className: `xmwr_c d-f fd-c ai-c jc-sb` + (minimized ? " minim" : ""), children: [_jsxs("div", { className: "xmwr-h w-100 m0 d-f fd-r jc-c bg-primary noselect", children: [_jsx("div", { className: "xmwr-title m0", children: props.title }), _jsx(MinimizeButton, { toggleMinimize: toggleMinimize, minimized: minimized })] }), _jsx("div", { className: "xmwr-b w-100 d-f jc-c", children: props.children })] }));
|
|
12
|
-
}
|
|
13
|
-
function MinimizeButton({ minimized, toggleMinimize }) {
|
|
14
|
-
const minimizeChar = minimized ? "+" : "-";
|
|
15
|
-
return (_jsx("div", { className: "xmwr-x m0", onClick: () => toggleMinimize(), children: minimizeChar }));
|
|
16
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|