layerpro 3.3.0 → 4.0.0
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/README.md +54 -49
- package/SECURITY-HARDENING.md +265 -0
- package/SECURITY.md +8 -0
- package/global.cjs +974 -0
- package/global.d.ts +27 -0
- package/global.js +974 -0
- package/index.cjs +424 -382
- package/index.css +4 -5
- package/index.d.ts +1 -0
- package/index.js +424 -382
- package/llms.txt +57 -55
- package/markdown/GUIDE.md +21 -22
- package/package.json +12 -4
- package/react.d.ts +32 -0
- package/types/layerpro.d.ts +63 -62
package/llms.txt
CHANGED
|
@@ -1,55 +1,57 @@
|
|
|
1
|
-
# LayerPro
|
|
2
|
-
|
|
3
|
-
> Dependency-free custom modals (alert, confirm, prompt, message) and advanced
|
|
4
|
-
> popups for the browser. Vanilla DOM (no jQuery); React/react-dom are external
|
|
5
|
-
> and used only to render the modal body. Dockable, draggable, resizable,
|
|
6
|
-
> maximizable (pure CSS), with an OS-style taskbar.
|
|
7
|
-
|
|
8
|
-
## Source
|
|
9
|
-
|
|
10
|
-
- [index.ts](index.ts): Entry point. Sets `window.layerpro` (frozen, non-enumerable), imports SCSS, initializes mode.
|
|
11
|
-
- [core/dom.ts](core/dom.ts): jQuery-free chainable DOM helper (`LpEl`, `lp`, `lpAll`, `lpCreate`, `lpDoc`, `lpWin`)
|
|
12
|
-
- [core/properties.ts](core/properties.ts): The `popup` object
|
|
13
|
-
- [core/genLayer.ts](core/genLayer.ts): DOM builder for a popup, dock/buttons wiring, pointer/click/dblclick handlers.
|
|
14
|
-
- [core/
|
|
15
|
-
- [core/
|
|
16
|
-
- [core/
|
|
17
|
-
- [core/
|
|
18
|
-
- [core/
|
|
19
|
-
- [core/
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
- [docs/
|
|
29
|
-
- [docs/
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
- [
|
|
36
|
-
- [tsup.
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
- **
|
|
43
|
-
- **
|
|
44
|
-
- **
|
|
45
|
-
- **
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
1
|
+
# LayerPro
|
|
2
|
+
|
|
3
|
+
> Dependency-free custom modals (alert, confirm, prompt, message) and advanced
|
|
4
|
+
> popups for the browser. Vanilla DOM (no jQuery); React/react-dom are external
|
|
5
|
+
> and used only to render the modal body. Dockable, draggable, resizable,
|
|
6
|
+
> maximizable (pure CSS), with an OS-style taskbar.
|
|
7
|
+
|
|
8
|
+
## Source
|
|
9
|
+
|
|
10
|
+
- [index.ts](index.ts): Entry point. Sets `window.layerpro` (frozen, non-enumerable), imports SCSS, initializes mode.
|
|
11
|
+
- [core/dom.ts](core/dom.ts): jQuery-free chainable DOM helper (`LpEl`, `lp`, `lpAll`, `lpCreate`, `lpDoc`, `lpWin`) - the replacement for jQuery.
|
|
12
|
+
- [core/properties.ts](core/properties.ts): The `popup` object - `open`, `close`, `center`, `maximize`, `iconize`, `index`, `zIndex`, `movable`, `resizable`, `cleanupEvents`, `unmount`.
|
|
13
|
+
- [core/genLayer.ts](core/genLayer.ts): DOM builder for a popup, dock/buttons wiring, pointer/click/dblclick handlers.
|
|
14
|
+
- [core/accessibility.ts](core/accessibility.ts): ARIA attributes, focus save/restore, Tab focus trap.
|
|
15
|
+
- [core/message.ts](core/message.ts): `alert`/`confirm`/`message`/`prompt` - Promise-based (resolve on close); in 4.0 globals are opt-in via `layerpro/global`, `noGlobals` is removed.
|
|
16
|
+
- [core/mode.ts](core/mode.ts): Close popups on orientation/size mode switch.
|
|
17
|
+
- [core/mobile.ts](core/mobile.ts): Unified pointer/mouse/touch events (`getPointerDown`/`getPointerMove`/`getPointerUp`).
|
|
18
|
+
- [core/window.ts](core/window.ts): Window-level helpers (scroll, size).
|
|
19
|
+
- [core/credits.ts](core/credits.ts): Credits overlay helper.
|
|
20
|
+
- [core/namespace.ts](core/namespace.ts): Global namespace setup.
|
|
21
|
+
|
|
22
|
+
## Types
|
|
23
|
+
|
|
24
|
+
- [types/layerpro.d.ts](types/layerpro.d.ts): Public TypeScript definitions (`GenLayerProps`, the `layerpro` global, `Window`/`globalThis` augmentations).
|
|
25
|
+
|
|
26
|
+
## Docs
|
|
27
|
+
|
|
28
|
+
- [docs/README.md](docs/README.md): Project README (features, install, quick start).
|
|
29
|
+
- [docs/markdown/GUIDE.md](docs/markdown/GUIDE.md): Example-driven usage guide (modals, popups, dock, maximize, resize, React body, API).
|
|
30
|
+
- [docs/llms.txt](docs/llms.txt): This file.
|
|
31
|
+
- [docs/SECURITY-HARDENING.md](docs/SECURITY-HARDENING.md): Security reference (CSP, XSS, SSRF, global overrides, accessibility).
|
|
32
|
+
|
|
33
|
+
## Build & Config
|
|
34
|
+
|
|
35
|
+
- [package.json](package.json): Manifest. React/react-dom are `devDependencies` (external at runtime); **jQuery removed**. `main`/`browser` → `index.js` (ESM), `exports.import` → `index.js`.
|
|
36
|
+
- [tsup.config.ts](tsup.config.ts): Build (CJS + ESM, terser minify, esbuild-sass-plugin). Externalizes devDependencies.
|
|
37
|
+
- [tsup.plugin.copyStatic.ts](tsup.plugin.copyStatic.ts): Copies static files (README, types, license) into `dist`.
|
|
38
|
+
- [tsup.plugin.injectCss.ts](tsup.plugin.injectCss.ts): Injects compiled SCSS into the bundle.
|
|
39
|
+
|
|
40
|
+
## Key behaviors
|
|
41
|
+
|
|
42
|
+
- **jQuery removed** - all DOM via `core/dom.ts`; public API unchanged.
|
|
43
|
+
- **React external** - only the modal `body` is rendered with `react-dom` `createRoot`.
|
|
44
|
+
- **Instant resize** - CSS `transition` disabled on the popup while resizing (no lag).
|
|
45
|
+
- **Maximize is pure CSS** - `position: fixed` + insets; follows viewport with no JS listeners.
|
|
46
|
+
- **Dock = OS taskbar** - click dock icon toggles restore / focus / minimize.
|
|
47
|
+
- **z-index** - set as unitless numbers; the base is read from the `--popup-z-index` CSS variable (default `1000`). Clicking the body or title bar selects (brings to front).
|
|
48
|
+
|
|
49
|
+
## Contributing
|
|
50
|
+
|
|
51
|
+
LayerPro is **open source** and free to use. The current codebase is private, but
|
|
52
|
+
**anyone is welcome to join**. If you would like to contribute, suggest changes,
|
|
53
|
+
or just chat about the project, contact the author:
|
|
54
|
+
|
|
55
|
+
- **Dario Passariello** - https://dario.passariello.ca/ - dariopassariello@gmail.com
|
|
56
|
+
|
|
57
|
+
Participation is voluntary and free; everyone is free to take part.
|
package/markdown/GUIDE.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# LayerPro Guide
|
|
2
2
|
|
|
3
|
-
> A practical, example-driven guide to LayerPro
|
|
3
|
+
> A practical, example-driven guide to LayerPro - the real custom modals
|
|
4
4
|
> (alert, confirm, prompt, message) and advanced popups for the browser.
|
|
5
5
|
|
|
6
6
|
LayerPro is **dependency-free**: it no longer uses jQuery. All DOM work is done
|
|
@@ -50,18 +50,17 @@ Import LayerPro once at your app entry point. It overrides the global
|
|
|
50
50
|
import "layerpro";
|
|
51
51
|
```
|
|
52
52
|
|
|
53
|
-
That single import is enough
|
|
53
|
+
That single import is enough - `window.layerpro` becomes available and the
|
|
54
54
|
global `alert`/`confirm`/`prompt` are replaced, and a `message` global is added.
|
|
55
55
|
|
|
56
|
-
> **⚠️ Global override
|
|
57
|
-
> `
|
|
58
|
-
>
|
|
59
|
-
>
|
|
60
|
-
> importing to restore the originals:
|
|
56
|
+
> **⚠️ Global override note:** in 4.0, `import 'layerpro'` does **not** override
|
|
57
|
+
> `window.alert`/`confirm`/`prompt`/`message`. The library methods
|
|
58
|
+
> (`layerpro.alert`, `layerpro.confirm`, etc.) return Promises. To override the
|
|
59
|
+
> browser globals with Promise-based versions, import the explicit entry point:
|
|
61
60
|
>
|
|
62
61
|
> ```javascript
|
|
63
|
-
> import "layerpro";
|
|
64
|
-
>
|
|
62
|
+
> import "layerpro/global"; // opt-in to global overrides
|
|
63
|
+
> await confirm("Sure?"); // Promise<boolean>
|
|
65
64
|
> ```
|
|
66
65
|
|
|
67
66
|
---
|
|
@@ -169,19 +168,18 @@ layerpro.popup.open({
|
|
|
169
168
|
iconize?: boolean, // allow minimize to dock
|
|
170
169
|
dockable?: boolean, // show an icon in the dock bar
|
|
171
170
|
close?: boolean, // show the close button
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
}
|
|
171
|
+
modal?: boolean, // show a full-screen overlay that blocks pointer events beneath
|
|
172
|
+
}
|
|
175
173
|
```
|
|
176
174
|
|
|
177
175
|
If `top/left/right/bottom` are all `0` (or unset) the popup is auto-centered.
|
|
178
176
|
Pass `center: true` to force centering regardless of the position props.
|
|
179
177
|
|
|
180
|
-
> **`
|
|
181
|
-
> that intercepts every pointer event
|
|
182
|
-
> until the popup closes.
|
|
178
|
+
> **`modal`** injects a full-viewport overlay (`popup_modal_<id>`)
|
|
179
|
+
> that intercepts every pointer event - the page underneath becomes unclickable
|
|
180
|
+
> until the popup closes.
|
|
183
181
|
|
|
184
|
-
> **Duplicate id**
|
|
182
|
+
> **Duplicate id** - opening a popup whose `id` already exists brings that window
|
|
185
183
|
> to the front and refreshes its `body`/`buttons` instead of doing nothing.
|
|
186
184
|
|
|
187
185
|
---
|
|
@@ -189,7 +187,7 @@ Pass `center: true` to force centering regardless of the position props.
|
|
|
189
187
|
## Dock & Taskbar
|
|
190
188
|
|
|
191
189
|
When `dockable` and `iconize` are enabled, a minimized popup becomes an icon in
|
|
192
|
-
the bottom dock bar
|
|
190
|
+
the bottom dock bar - exactly like an OS taskbar:
|
|
193
191
|
|
|
194
192
|
```javascript
|
|
195
193
|
layerpro.popup.open({
|
|
@@ -215,7 +213,7 @@ The close `✕` on the dock icon closes the popup completely.
|
|
|
215
213
|
## Maximize & Minimize
|
|
216
214
|
|
|
217
215
|
Maximize is implemented with **pure CSS** (`position: fixed` + `inset`), so the
|
|
218
|
-
popup fills the viewport and follows window resizing automatically
|
|
216
|
+
popup fills the viewport and follows window resizing automatically - no JS
|
|
219
217
|
resize listeners are involved.
|
|
220
218
|
|
|
221
219
|
```javascript
|
|
@@ -313,7 +311,8 @@ layerpro.popup.index({ id: "myModal" });
|
|
|
313
311
|
| `layerpro.popup.store(element)` | Store a reference (placeholder/extensibility) |
|
|
314
312
|
| `layerpro.popup.cleanupEvents(id)` | Remove dock/button/esc listeners |
|
|
315
313
|
| `layerpro.popup.unmount(id)` | Unmount the React root (memory cleanup) |
|
|
316
|
-
| `layerpro.
|
|
314
|
+
| `layerpro.config(opts)` | Runtime config. Supports `{ nonce: string }` for CSP; sets `window.__layerproNonce`. Call before importing LayerPro for the nonce to be present at CSS injection time |
|
|
315
|
+
| `layerpro.installGlobals()` | Explicitly install global `alert`/`confirm`/`prompt`/`message` overrides (opt-in in 4.0) |
|
|
317
316
|
|
|
318
317
|
---
|
|
319
318
|
|
|
@@ -340,12 +339,12 @@ properties, so theming needs no `!important` and no `[class^=popup_…]` selecto
|
|
|
340
339
|
| `--window-border-radius` | popup border radius |
|
|
341
340
|
| `--internal-background` | body wrapper |
|
|
342
341
|
| `--body-color` | body text color |
|
|
343
|
-
| `--
|
|
342
|
+
| `--modal-background` | modal overlay |
|
|
344
343
|
| `--popup-z-index` (in root.scss) | base z-index for the stack |
|
|
345
344
|
|
|
346
345
|
Stable class names (`.popup_bar`, `.popup_window`, `.popup_overflow`,
|
|
347
346
|
`.popup_internal`, `.popup_body`, `.popup_drag`, `.popup_icon`, `.popup_option`,
|
|
348
|
-
`.
|
|
347
|
+
`.popup_modal`) are emitted alongside the per-id classes so themes can target
|
|
349
348
|
elements without attribute selectors.
|
|
350
349
|
|
|
351
350
|
---
|
|
@@ -364,4 +363,4 @@ elements without attribute selectors.
|
|
|
364
363
|
|
|
365
364
|
---
|
|
366
365
|
|
|
367
|
-
© [Dario Passariello](https://dario.passariello.ca/)
|
|
366
|
+
© [Dario Passariello](https://dario.passariello.ca/) - MIT License
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "layerpro",
|
|
3
3
|
"codeName": "layerpro",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "4.0.0",
|
|
5
5
|
"description": "The real custom modals, alert, confirm, prompt... for your browser",
|
|
6
6
|
"main": "./index.cjs",
|
|
7
7
|
"module": "./index.js",
|
|
@@ -18,6 +18,12 @@
|
|
|
18
18
|
"require": "./react.cjs",
|
|
19
19
|
"types": "./react.d.ts"
|
|
20
20
|
},
|
|
21
|
+
"./global": {
|
|
22
|
+
"import": "./global.js",
|
|
23
|
+
"require": "./global.cjs",
|
|
24
|
+
"types": "./global.d.ts"
|
|
25
|
+
},
|
|
26
|
+
"./style.css": "./index.css",
|
|
21
27
|
"./types/*": "./types/*"
|
|
22
28
|
},
|
|
23
29
|
"license": "MIT",
|
|
@@ -66,8 +72,13 @@
|
|
|
66
72
|
"llms.txt",
|
|
67
73
|
"package.json",
|
|
68
74
|
"react.cjs",
|
|
75
|
+
"react.d.ts",
|
|
69
76
|
"react.js",
|
|
77
|
+
"global.cjs",
|
|
78
|
+
"global.d.ts",
|
|
79
|
+
"global.js",
|
|
70
80
|
"README.md",
|
|
81
|
+
"SECURITY-HARDENING.md",
|
|
71
82
|
"SECURITY.md"
|
|
72
83
|
],
|
|
73
84
|
"peerDependencies": {
|
|
@@ -79,9 +90,6 @@
|
|
|
79
90
|
"url": "https://dario.passariello.ca/",
|
|
80
91
|
"email": "dariopassariello@gmail.com"
|
|
81
92
|
},
|
|
82
|
-
"resolutions": {
|
|
83
|
-
"esbuild": "^0.25.0"
|
|
84
|
-
},
|
|
85
93
|
"overrides": {
|
|
86
94
|
"esbuild": "^0.28.2"
|
|
87
95
|
},
|
package/react.d.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/// <reference path="./types/layerpro.d.ts" />
|
|
2
|
+
/// <reference types="react" />
|
|
3
|
+
|
|
4
|
+
import type { GenLayerProps } from "./types/layerpro"
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* React adapter for LayerPro - powered by reattach.
|
|
8
|
+
*
|
|
9
|
+
* Lazily loaded by the core when a React element is passed as a layer body.
|
|
10
|
+
* This keeps react-dom out of the core bundle.
|
|
11
|
+
*
|
|
12
|
+
* reattach handles root creation, root reuse on duplicate-id reopen,
|
|
13
|
+
* context bridging (inheritContext), and auto-healing DOM (resilient).
|
|
14
|
+
*
|
|
15
|
+
* @param props - The layer props containing a ReactElement body
|
|
16
|
+
* @param container - The DOM node to mount into
|
|
17
|
+
*/
|
|
18
|
+
declare function renderReactBody(
|
|
19
|
+
props: GenLayerProps,
|
|
20
|
+
container: HTMLElement
|
|
21
|
+
): void
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Unmount a previously mounted React body via reattach.
|
|
25
|
+
* Called by LayerPro's close() lifecycle to prevent memory leaks.
|
|
26
|
+
*
|
|
27
|
+
* @param id - The layer ID (same as props.id used in renderReactBody)
|
|
28
|
+
*/
|
|
29
|
+
declare function unmountReactBody(id: string): void
|
|
30
|
+
|
|
31
|
+
export { unmountReactBody }
|
|
32
|
+
export default renderReactBody
|
package/types/layerpro.d.ts
CHANGED
|
@@ -1,23 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
|
|
10
|
-
declare function confirm(message: string, func1: (yes: boolean) => void, func2?: (no: boolean) => void): void
|
|
11
|
-
|
|
12
|
-
/** Generate custom message using message([text],[callback]) and option callback */
|
|
13
|
-
declare function message(f1?: string, func1?: () => void): void
|
|
14
|
-
|
|
15
|
-
/** Generate custom prompt using prompt([text],[callback]) and option callback
|
|
16
|
-
* WARNING: This overrides the native prompt(). The return value is NOT a usable
|
|
17
|
-
* string — use the callback to receive the input. */
|
|
18
|
-
declare function prompt(f1?: string, func1?: (input: string) => void): void
|
|
19
|
-
|
|
20
|
-
///
|
|
3
|
+
/**
|
|
4
|
+
* LayerPro - the real custom modals for your browser.
|
|
5
|
+
*
|
|
6
|
+
* In 4.0, importing `layerpro` no longer overrides `window.alert` /
|
|
7
|
+
* `window.confirm` / `window.prompt` / `window.message`. To opt in to the
|
|
8
|
+
* global overrides, import the `layerpro/global` entrypoint instead.
|
|
9
|
+
*/
|
|
21
10
|
|
|
22
11
|
interface LayerButtonConfig {
|
|
23
12
|
text: string
|
|
@@ -63,7 +52,7 @@ interface GenLayerProps {
|
|
|
63
52
|
|
|
64
53
|
resizable?: boolean
|
|
65
54
|
close?: boolean
|
|
66
|
-
|
|
55
|
+
/** Modal overlay - intercepts pointer events on the underlying page. */
|
|
67
56
|
modal?: boolean
|
|
68
57
|
iconize?: boolean
|
|
69
58
|
center?: boolean
|
|
@@ -77,57 +66,69 @@ interface GenLayerProps {
|
|
|
77
66
|
/**
|
|
78
67
|
* Interface for the layerpro object
|
|
79
68
|
*/
|
|
80
|
-
interface _layerpro {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
69
|
+
interface _layerpro {
|
|
70
|
+
|
|
71
|
+
/** Optional CSP nonce. Set via `layerpro.config({ nonce })` before importing
|
|
72
|
+
* the CSS-in-JS bundle so the injected `<style>` element passes strict CSP.
|
|
73
|
+
* If unset, the nonce is auto-detected from existing `<style>`/`<script>`
|
|
74
|
+
* elements on the page. */
|
|
75
|
+
nonce?: string
|
|
76
|
+
|
|
77
|
+
/** Runtime configuration. Currently supports `{ nonce: string }` for CSP. */
|
|
78
|
+
config: (opts: { nonce?: string }) => void
|
|
79
|
+
|
|
80
|
+
/** Open a LayerPro alert. Returns a Promise that resolves when the popup closes. */
|
|
81
|
+
readonly alert: (txt: string) => Promise<void>
|
|
82
|
+
/** Open a LayerPro prompt. Returns a Promise that resolves to the input string. */
|
|
83
|
+
readonly prompt: (txt: string, defaultValue?: string) => Promise<string>
|
|
84
|
+
/** Open a LayerPro message popup. Returns a Promise that resolves when it closes. */
|
|
85
|
+
readonly message: (txt: string) => Promise<void>
|
|
86
|
+
/** Open a LayerPro confirm. Returns a Promise that resolves to a boolean. */
|
|
87
|
+
readonly confirm: (txt: string) => Promise<boolean>
|
|
88
|
+
readonly credits: (props: { name: string, version: string, description: string, license: string, author: { name: string, email: string } }) => void
|
|
89
|
+
|
|
90
|
+
setProps: (obj: Record<string, unknown>, options?: { enumerable?: boolean, writable?: boolean, configurable?: boolean }) => void
|
|
91
|
+
|
|
92
|
+
/** Opt-in to override the browser's native `alert`/`confirm`/`prompt`/`message`
|
|
93
|
+
* globals with LayerPro's Promise-based versions. Call this explicitly after
|
|
94
|
+
* importing LayerPro - the default entry does **not** auto-override in 4.0.
|
|
95
|
+
* Alternatively, use `import 'layerpro/global'`. */
|
|
96
|
+
readonly installGlobals: () => void
|
|
97
|
+
|
|
98
|
+
readonly popup: {
|
|
99
|
+
/** Open a modal; returns a Promise that resolves with the props when the popup closes. */
|
|
100
|
+
open: (props: GenLayerProps) => Promise<GenLayerProps>
|
|
101
|
+
center: (id: string | number | GenLayerProps, offset?: number) => void
|
|
102
|
+
maximize: (props: GenLayerProps) => void
|
|
103
|
+
iconize: (id: string | number | GenLayerProps) => void
|
|
104
|
+
movable: (props: GenLayerProps) => void
|
|
105
|
+
resizable: (props: GenLayerProps) => void
|
|
106
|
+
store: (element: unknown) => void
|
|
107
|
+
index: (id: string | number | GenLayerProps) => void
|
|
108
|
+
close: (id: string | number | GenLayerProps | null | undefined) => void
|
|
109
|
+
unmount: (id: string) => void
|
|
110
|
+
cleanupEvents: (id: string) => void
|
|
111
|
+
abortSource: (id: string) => void
|
|
112
|
+
/** @internal - managed internally for stacking order; do not call. */
|
|
113
|
+
zIndex: (props?: GenLayerProps) => number
|
|
114
|
+
useReactAdapter?: (props: GenLayerProps, container: HTMLElement) => void
|
|
115
|
+
}
|
|
117
116
|
|
|
118
|
-
}
|
|
117
|
+
}
|
|
119
118
|
|
|
120
119
|
/**
|
|
121
|
-
*
|
|
122
|
-
* `message`
|
|
123
|
-
*
|
|
120
|
+
* In 4.0, `layerpro` and `popup` are declared on `Window` but the native
|
|
121
|
+
* `alert`/`confirm`/`prompt`/`message` globals are NOT overridden by the
|
|
122
|
+
* default entry. Import `layerpro/global` to override them with Promise-based
|
|
123
|
+
* versions.
|
|
124
124
|
*/
|
|
125
125
|
interface Window {
|
|
126
126
|
layerpro: _layerpro
|
|
127
|
+
popup: _layerpro['popup']
|
|
127
128
|
}
|
|
128
129
|
|
|
129
130
|
declare var layerpro: _layerpro
|
|
130
131
|
type layerpro = _layerpro
|
|
131
132
|
|
|
132
|
-
declare var popup:
|
|
133
|
-
type popup =
|
|
133
|
+
declare var popup: _layerpro['popup']
|
|
134
|
+
type popup = _layerpro['popup']
|