@hazem3500/palette 0.9.114 → 0.9.115
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 +2 -2
- package/dist/chunk-PI5FFV5P.js +1 -0
- package/dist/index.js +1 -1
- package/dist/node.mjs +1 -1
- package/dist/react.js +1 -1
- package/dist/server.js +1 -1
- package/dist/setup.js +1 -1
- package/dist/shell-mode-RPV7AVA4.js +1 -0
- package/dist/shell-mode.d.ts +2 -2
- package/dist/shell-session.d.ts +1 -1
- package/dist/types.d.ts +1 -0
- package/package.json +1 -1
- package/server/setup-client.txt +57 -57
- package/src/types.ts +1 -0
- package/dist/chunk-AXW6CU4X.js +0 -1
- package/dist/shell-mode-PLV6F474.js +0 -1
package/dist/setup.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as n,d as o}from"./chunk-
|
|
1
|
+
import{a as n,d as o}from"./chunk-PI5FFV5P.js";import"./chunk-KLPQTFVH.js";import"./chunk-RBHY7UDS.js";import"./chunk-LMXFSXO6.js";import"./chunk-DU7H4TEX.js";import"./chunk-5HZI7HRR.js";import"./chunk-2BS2OWWH.js";import"./chunk-J47R52WX.js";import"./chunk-VX6XCU4E.js";import"./chunk-4HBBEVFK.js";function r(r){return(t={})=>o(n({...r,...t}))}var t=r;export{t as defineKomo,r as definePalette};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e="palette-shell",t="palette:shell";function a(t,a){let o=new URL(t,location.href);return o.searchParams.delete("komo-shell"),a?o.searchParams.set(e,a):o.searchParams.delete(e),o.href}function o(e,o=""){try{sessionStorage.removeItem(t),sessionStorage.removeItem("komo:shell"),o&&sessionStorage.setItem("palette:shell-off",o)}catch{}location.replace(a(e,""))}function l(e,o,l,r){try{let n=sessionStorage.getItem("palette:shell-off");if(n)return r(n);if(o&&!confirm(`Reload in Frame?\n\nUnsaved app changes${l?" and unposted Design changes":""} will be lost.`))return r("Reload cancelled.");let s=Array.from(crypto.getRandomValues(new Uint8Array(16)),e=>e.toString(16).padStart(2,"0")).join("");sessionStorage.setItem(t,JSON.stringify({v:1,project:e,nonce:s,origin:location.origin})),location.replace(a(location.href,s))}catch{return r("Storage blocked.")}setTimeout(r,3e3,"Reload cancelled.")}function r(e,t){try{let o=e.location.href,l=a(o,t);o.startsWith(location.origin)&&l!==location.href&&history.replaceState(history.state,"",l)}catch{}}export{l as enterShell,o as leaveShellPage,a as shellUrl,r as syncShell};
|
package/dist/shell-mode.d.ts
CHANGED
|
@@ -4,9 +4,9 @@ export declare function shellUrl(href: string, nonce: string): string;
|
|
|
4
4
|
export declare function leaveShellPage(href: string, reason?: string): void;
|
|
5
5
|
/**
|
|
6
6
|
* Reloads this page as the shell. `ask` confirms first; `fallback` runs when the
|
|
7
|
-
* reviewer
|
|
7
|
+
* reviewer cancels, storage is blocked, or the page didn't unload (the
|
|
8
8
|
* app's own unsaved-changes guard can keep it).
|
|
9
9
|
*/
|
|
10
|
-
export declare function enterShell(project: string, ask: boolean, edited: boolean, fallback: () => void): void;
|
|
10
|
+
export declare function enterShell(project: string, ask: boolean, edited: boolean, fallback: (reason: string) => void): void;
|
|
11
11
|
/** The shell's URL follows the frame's route, so reloading or sharing it keeps the page. */
|
|
12
12
|
export declare function syncShell(view: Window | null | undefined, nonce: string): void;
|
package/dist/shell-session.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export declare const SHELL_PARAM = "palette-shell";
|
|
|
4
4
|
export declare const LEGACY_SHELL_PARAM = "komo-shell";
|
|
5
5
|
/** sessionStorage: the shell Palette started in this tab, `{ v, project, nonce, origin }`. */
|
|
6
6
|
export declare const SHELL_KEY = "palette:shell";
|
|
7
|
-
/** sessionStorage: why the last shell ended early. This tab
|
|
7
|
+
/** sessionStorage: why the last shell ended early. This tab stays on the normal page until an explicit retry. */
|
|
8
8
|
export declare const SHELL_OFF_KEY = "palette:shell-off";
|
|
9
9
|
/** The page's shell nonce, when Palette started a shell for `project` in this tab; else "". */
|
|
10
10
|
export declare function shellNonce(project: string): string;
|
package/dist/types.d.ts
CHANGED
|
@@ -275,6 +275,7 @@ export interface CommentsOptions {
|
|
|
275
275
|
* Single-copy simulated viewport (with mode "iframe"): turning it on reloads this page as a
|
|
276
276
|
* shell for Palette, so the app runs once, in the frame. Requires the app's entry
|
|
277
277
|
* to skip mounting when `isShell(project)` from `@hazem3500/palette/shell` is true.
|
|
278
|
+
* Cancellation or failure keeps the normal page; a second app is never loaded as fallback.
|
|
278
279
|
*/
|
|
279
280
|
shell?: boolean;
|
|
280
281
|
};
|