@selectwin/kit 0.1.67 → 0.1.69
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/SelectPreviewFrame.d.ts +15 -1
- package/dist/index.js +2974 -2922
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
1
|
+
import { ReactNode, Ref } from 'react';
|
|
2
2
|
type Device = 'desktop' | 'mobile';
|
|
3
3
|
export interface SelectPreviewFrameProps {
|
|
4
4
|
/** Preview URL. Empty/undefined shows the placeholder. */
|
|
@@ -23,6 +23,20 @@ export interface SelectPreviewFrameProps {
|
|
|
23
23
|
* desatualizada. Então: avisa e oferece o botão — não age.
|
|
24
24
|
*/
|
|
25
25
|
notice?: ReactNode;
|
|
26
|
+
/**
|
|
27
|
+
* Ref para o `<iframe>` INTERNO — o `ref` do componente aponta para o wrapper, e de um
|
|
28
|
+
* `<div>` não se alcança `contentWindow`.
|
|
29
|
+
*
|
|
30
|
+
* Existe para quem DIRIGE o conteúdo do frame por `postMessage` em vez de recarregá-lo: um
|
|
31
|
+
* builder que manda o desenho ao vivo precisa da janela do frame, e a alternativa — sair
|
|
32
|
+
* fazendo `querySelector('iframe')` no wrapper — amarraria a página à árvore interna deste
|
|
33
|
+
* componente, que é exatamente o que a prop existe para evitar.
|
|
34
|
+
*
|
|
35
|
+
* ⚠️ O frame REMONTA a cada recarga (o `key` do nonce), então o ref troca de nó. Quem
|
|
36
|
+
* dirige não deve guardar `contentWindow`: leia-o do ref na hora de mandar, e refaça o
|
|
37
|
+
* aperto de mão a cada `load`.
|
|
38
|
+
*/
|
|
39
|
+
iframeRef?: Ref<HTMLIFrameElement>;
|
|
26
40
|
initialDevice?: Device;
|
|
27
41
|
showDeviceToggle?: boolean;
|
|
28
42
|
emptyLabel?: string;
|