@scayle/storefront-devtools 0.2.0-alpha.1
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/CHANGELOG.md +15 -0
- package/README.md +222 -0
- package/dist/_chunks/clipboard-DrVHc2QA.mjs +61 -0
- package/dist/_chunks/diff-DzJ5arJj.mjs +169 -0
- package/dist/_chunks/panel-uV5ITqhY.mjs +51 -0
- package/dist/_chunks/redact-DmIF-iyk.mjs +96 -0
- package/dist/_chunks/useStore-Db8RZW8T.mjs +10 -0
- package/dist/group.d.ts +42 -0
- package/dist/group.d.ts.map +1 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.mjs +178 -0
- package/dist/inertia/client/index.d.mts +13 -0
- package/dist/inertia/client/index.d.ts +7 -0
- package/dist/inertia/client/index.d.ts.map +1 -0
- package/dist/inertia/client/index.mjs +694 -0
- package/dist/inertia/core/capture.d.ts +15 -0
- package/dist/inertia/core/capture.d.ts.map +1 -0
- package/dist/inertia/core/correlator.d.ts +91 -0
- package/dist/inertia/core/correlator.d.ts.map +1 -0
- package/dist/inertia/core/diagnostics.d.ts +10 -0
- package/dist/inertia/core/diagnostics.d.ts.map +1 -0
- package/dist/inertia/core/diff.d.ts +33 -0
- package/dist/inertia/core/diff.d.ts.map +1 -0
- package/dist/inertia/core/events-tab.d.ts +20 -0
- package/dist/inertia/core/events-tab.d.ts.map +1 -0
- package/dist/inertia/core/feature-info.d.ts +14 -0
- package/dist/inertia/core/feature-info.d.ts.map +1 -0
- package/dist/inertia/core/features.d.ts +27 -0
- package/dist/inertia/core/features.d.ts.map +1 -0
- package/dist/inertia/core/history-capture.d.ts +15 -0
- package/dist/inertia/core/history-capture.d.ts.map +1 -0
- package/dist/inertia/core/interceptors.d.ts +69 -0
- package/dist/inertia/core/interceptors.d.ts.map +1 -0
- package/dist/inertia/core/markdown.d.ts +10 -0
- package/dist/inertia/core/markdown.d.ts.map +1 -0
- package/dist/inertia/core/network.d.ts +34 -0
- package/dist/inertia/core/network.d.ts.map +1 -0
- package/dist/inertia/core/protocol.d.ts +38 -0
- package/dist/inertia/core/protocol.d.ts.map +1 -0
- package/dist/inertia/core/request-tree.d.ts +18 -0
- package/dist/inertia/core/request-tree.d.ts.map +1 -0
- package/dist/inertia/core/response.d.ts +39 -0
- package/dist/inertia/core/response.d.ts.map +1 -0
- package/dist/inertia/core/session.d.ts +18 -0
- package/dist/inertia/core/session.d.ts.map +1 -0
- package/dist/inertia/core/store.d.ts +40 -0
- package/dist/inertia/core/store.d.ts.map +1 -0
- package/dist/inertia/core/types.d.ts +112 -0
- package/dist/inertia/core/types.d.ts.map +1 -0
- package/dist/inertia/core/url.d.ts +11 -0
- package/dist/inertia/core/url.d.ts.map +1 -0
- package/dist/inertia/plugin.d.ts +11 -0
- package/dist/inertia/plugin.d.ts.map +1 -0
- package/dist/inertia/renderer/index.d.mts +16 -0
- package/dist/inertia/renderer/index.mjs +771 -0
- package/dist/inject.d.ts +12 -0
- package/dist/inject.d.ts.map +1 -0
- package/dist/orpc/client/index.d.mts +13 -0
- package/dist/orpc/client/index.d.ts +7 -0
- package/dist/orpc/client/index.d.ts.map +1 -0
- package/dist/orpc/client/index.mjs +502 -0
- package/dist/orpc/core/capture.d.ts +32 -0
- package/dist/orpc/core/capture.d.ts.map +1 -0
- package/dist/orpc/core/classify.d.ts +14 -0
- package/dist/orpc/core/classify.d.ts.map +1 -0
- package/dist/orpc/core/curl.d.ts +11 -0
- package/dist/orpc/core/curl.d.ts.map +1 -0
- package/dist/orpc/core/markdown.d.ts +12 -0
- package/dist/orpc/core/markdown.d.ts.map +1 -0
- package/dist/orpc/core/orpc-error.d.ts +18 -0
- package/dist/orpc/core/orpc-error.d.ts.map +1 -0
- package/dist/orpc/core/serialize.d.ts +12 -0
- package/dist/orpc/core/serialize.d.ts.map +1 -0
- package/dist/orpc/core/session.d.ts +15 -0
- package/dist/orpc/core/session.d.ts.map +1 -0
- package/dist/orpc/core/store.d.ts +50 -0
- package/dist/orpc/core/store.d.ts.map +1 -0
- package/dist/orpc/core/types.d.ts +67 -0
- package/dist/orpc/core/types.d.ts.map +1 -0
- package/dist/orpc/core/url.d.ts +12 -0
- package/dist/orpc/core/url.d.ts.map +1 -0
- package/dist/orpc/plugin.d.ts +10 -0
- package/dist/orpc/plugin.d.ts.map +1 -0
- package/dist/orpc/renderer/index.d.mts +16 -0
- package/dist/orpc/renderer/index.mjs +457 -0
- package/dist/resource-center/client/index.mjs +21 -0
- package/dist/resource-center/client.d.ts +3 -0
- package/dist/resource-center/client.d.ts.map +1 -0
- package/dist/resource-center/plugin.d.ts +12 -0
- package/dist/resource-center/plugin.d.ts.map +1 -0
- package/dist/shared/clipboard.d.ts +9 -0
- package/dist/shared/clipboard.d.ts.map +1 -0
- package/dist/shared/redact.d.ts +27 -0
- package/dist/shared/redact.d.ts.map +1 -0
- package/dist/shared/safe-clone.d.ts +46 -0
- package/dist/shared/safe-clone.d.ts.map +1 -0
- package/dist/shared/session-storage.d.ts +18 -0
- package/dist/shared/session-storage.d.ts.map +1 -0
- package/dist/shared/use-window-store.d.ts +18 -0
- package/dist/shared/use-window-store.d.ts.map +1 -0
- package/dist/storefront/plugin.d.ts +9 -0
- package/dist/storefront/plugin.d.ts.map +1 -0
- package/dist/storefront/renderer/index.d.mts +16 -0
- package/dist/storefront/renderer/index.mjs +124 -0
- package/dist/vue-devtools/client/index.mjs +4912 -0
- package/dist/vue-devtools/client.d.ts +2 -0
- package/dist/vue-devtools/client.d.ts.map +1 -0
- package/dist/vue-devtools/plugin.d.ts +14 -0
- package/dist/vue-devtools/plugin.d.ts.map +1 -0
- package/dist/vue-devtools/ui/assets/css-8QJvnqUH.js +1 -0
- package/dist/vue-devtools/ui/assets/css-CaJ9TzKE.js +1 -0
- package/dist/vue-devtools/ui/assets/diff-woXpYk--.js +1 -0
- package/dist/vue-devtools/ui/assets/html-BHDw6EPc.js +1 -0
- package/dist/vue-devtools/ui/assets/html-GueGcY0x.js +1 -0
- package/dist/vue-devtools/ui/assets/index-Dby9TIQH.js +156 -0
- package/dist/vue-devtools/ui/assets/index-sSkqWPzY.css +1 -0
- package/dist/vue-devtools/ui/assets/javascript-BzbQS41l.js +1 -0
- package/dist/vue-devtools/ui/assets/javascript-Yelw-5ZN.js +1 -0
- package/dist/vue-devtools/ui/assets/json-B88Oqtu5.js +1 -0
- package/dist/vue-devtools/ui/assets/json-CaljABEy.js +1 -0
- package/dist/vue-devtools/ui/assets/shellscript-CLZ0U2zV.js +1 -0
- package/dist/vue-devtools/ui/assets/typescript-Utq2Cl8c.js +1 -0
- package/dist/vue-devtools/ui/assets/typescript-j_1H8WHN.js +1 -0
- package/dist/vue-devtools/ui/assets/vitesse-dark-BZCL-v6S.js +1 -0
- package/dist/vue-devtools/ui/assets/vitesse-light-VbXTXTou.js +1 -0
- package/dist/vue-devtools/ui/assets/vue-B1Tf5CHw.js +1 -0
- package/dist/vue-devtools/ui/assets/vue-html-CGMs_6qn.js +1 -0
- package/dist/vue-devtools/ui/assets/yaml-rwi0_p6S.js +1 -0
- package/dist/vue-devtools/ui/index.html +13 -0
- package/package.json +101 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Plugin } from 'vite';
|
|
2
|
+
/**
|
|
3
|
+
* Creates the Vite plugin that registers the "Resource Center" dock entry: an
|
|
4
|
+
* iframe linking to the SCAYLE Storefront documentation, attached to the
|
|
5
|
+
* "SCAYLE Storefront" dock group via `groupId`. Its companion client script,
|
|
6
|
+
* which gives the iframe a white background, is injected into the host entry
|
|
7
|
+
* alongside the other panels' clients; see `src/index.ts`. The dock paints
|
|
8
|
+
* its iframe container transparent over the dark chrome and exposes no
|
|
9
|
+
* per-entry background option.
|
|
10
|
+
*/
|
|
11
|
+
export declare function createResourceCenterPlugin(): Plugin;
|
|
12
|
+
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/resource-center/plugin.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAWlC;;;;;;;;GAQG;AACH,wBAAgB,0BAA0B,IAAI,MAAM,CAgBnD"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Writes text to the clipboard when running in the browser. No-op during SSR
|
|
3
|
+
* or when the Clipboard API is unavailable. Matches the SSR-guard idiom used
|
|
4
|
+
* in `core/history-capture.ts` and `resource-center/client.ts`.
|
|
5
|
+
*
|
|
6
|
+
* @param text - The text to copy.
|
|
7
|
+
*/
|
|
8
|
+
export declare function copyText(text: string): void;
|
|
9
|
+
//# sourceMappingURL=clipboard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clipboard.d.ts","sourceRoot":"","sources":["../../src/shared/clipboard.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAI3C"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checks whether a key's value carries a credential and must not be stored.
|
|
3
|
+
*
|
|
4
|
+
* Passed to `safeClone` as its `redactKey` option, so redaction happens during
|
|
5
|
+
* the copy rather than in a second pass over the result.
|
|
6
|
+
*
|
|
7
|
+
* @param key - Object key or header name to test.
|
|
8
|
+
* @returns True when the value must be replaced.
|
|
9
|
+
*/
|
|
10
|
+
export declare function isSensitiveKey(key: string): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Builds the `redactKey` predicate for one procedure's captured input,
|
|
13
|
+
* combining the procedure-agnostic pattern with that procedure's own
|
|
14
|
+
* sensitive keys (see {@link SENSITIVE_INPUT_BY_PROCEDURE}).
|
|
15
|
+
*
|
|
16
|
+
* @param procedure - Dot-separated procedure name the input belongs to.
|
|
17
|
+
* @returns A predicate suitable for `safeClone`'s `redactKey` option.
|
|
18
|
+
*/
|
|
19
|
+
export declare function isSensitiveInputKey(procedure: string): (key: string) => boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Removes credential-bearing request headers from a captured record.
|
|
22
|
+
*
|
|
23
|
+
* @param headers - Lowercased header record read off the request.
|
|
24
|
+
* @returns A copy without the sensitive headers.
|
|
25
|
+
*/
|
|
26
|
+
export declare function redactHeaders(headers: Record<string, string>): Record<string, string>;
|
|
27
|
+
//# sourceMappingURL=redact.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redact.d.ts","sourceRoot":"","sources":["../../src/shared/redact.ts"],"names":[],"mappings":"AA2CA;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAEnD;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,MAAM,GAChB,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAI1B;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC9B,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CASxB"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/** Maximum object depth traversed before a subtree is replaced with a marker. */
|
|
2
|
+
export declare const MAX_CLONE_DEPTH = 10;
|
|
3
|
+
/** Placeholder written in place of a value whose key was redacted. */
|
|
4
|
+
export declare const REDACTED = "[redacted]";
|
|
5
|
+
/** Options controlling how a value is copied. */
|
|
6
|
+
export interface SafeCloneOptions {
|
|
7
|
+
/**
|
|
8
|
+
* Called with each object key; return true to store {@link REDACTED} in place
|
|
9
|
+
* of that key's value. Used to keep credentials out of captured payloads.
|
|
10
|
+
*/
|
|
11
|
+
redactKey?: (key: string) => boolean;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Copies a captured value into a plain, serializable structure.
|
|
15
|
+
*
|
|
16
|
+
* Captured payloads come from a live application: Inertia event details carry
|
|
17
|
+
* `AbortController`s and functions, and oRPC responses come back from
|
|
18
|
+
* `decodeRpcPayload` holding `Date`, `Map`, `Set`, `URL`, and `RegExp`
|
|
19
|
+
* instances. `structuredClone` throws on functions and `URL`, and a bare
|
|
20
|
+
* `Object.entries` walk flattens every structured type to `{}`, so the panel
|
|
21
|
+
* would show empty objects where the decoded values should be. This converts
|
|
22
|
+
* each of those to a readable form instead.
|
|
23
|
+
*
|
|
24
|
+
* Cyclic references are replaced with a marker, and traversal stops at
|
|
25
|
+
* {@link MAX_CLONE_DEPTH}, so a self-referential or deeply nested graph can
|
|
26
|
+
* neither recurse forever nor expand into an unbounded copy.
|
|
27
|
+
*
|
|
28
|
+
* @param value - The captured value to copy.
|
|
29
|
+
* @param options - Copy options, notably `redactKey` for credential removal.
|
|
30
|
+
* @param depth - Remaining depth budget; defaults to {@link MAX_CLONE_DEPTH}.
|
|
31
|
+
* @param seen - Ancestor objects on the current path, used to detect cycles.
|
|
32
|
+
* @returns A structure safe to store, diff, and serialize to JSON.
|
|
33
|
+
*/
|
|
34
|
+
export declare function safeClone(value: unknown, options?: SafeCloneOptions, depth?: number, seen?: Set<object>): unknown;
|
|
35
|
+
/**
|
|
36
|
+
* Copies a `CustomEvent.detail` into a plain record for storage.
|
|
37
|
+
*
|
|
38
|
+
* Normalizes the two shapes a detail can take: a non-object payload is wrapped
|
|
39
|
+
* under a `value` key so the stored shape stays consistent, and an object
|
|
40
|
+
* payload has each of its properties copied through {@link safeClone}.
|
|
41
|
+
*
|
|
42
|
+
* @param detail - The event detail to copy; may be null or a primitive.
|
|
43
|
+
* @returns A record safe to store; empty when the detail is absent or unreadable.
|
|
44
|
+
*/
|
|
45
|
+
export declare function safeSerializeDetail(detail: unknown): Record<string, unknown>;
|
|
46
|
+
//# sourceMappingURL=safe-clone.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"safe-clone.d.ts","sourceRoot":"","sources":["../../src/shared/safe-clone.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,eAAO,MAAM,eAAe,KAAK,CAAA;AAEjC,sEAAsE;AACtE,eAAO,MAAM,QAAQ,eAAe,CAAA;AAKpC,iDAAiD;AACjD,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAA;CACrC;AAwDD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,SAAS,CACvB,KAAK,EAAE,OAAO,EACd,OAAO,GAAE,gBAAqB,EAC9B,KAAK,GAAE,MAAwB,EAC/B,IAAI,GAAE,GAAG,CAAC,MAAM,CAAa,GAC5B,OAAO,CAsBT;AAED;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAkB5E"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates `sessionStorage` save/load/clear functions scoped to one key.
|
|
3
|
+
* Backs the Inertia and oRPC panels' `saveSession`/`loadSession`/`clearSession`,
|
|
4
|
+
* which persist a compact summary of the previous page-load's captures so the
|
|
5
|
+
* panel can show them after a full reload wipes the in-memory store.
|
|
6
|
+
*
|
|
7
|
+
* @param key - The `sessionStorage` key to persist under.
|
|
8
|
+
* @returns `save`, `load`, and `clear` functions scoped to that key. `load`
|
|
9
|
+
* returns null when nothing is stored or the stored snapshot has expired.
|
|
10
|
+
*/
|
|
11
|
+
export declare function createSessionStorage<TSnapshot extends {
|
|
12
|
+
savedAt: number;
|
|
13
|
+
}>(key: string): {
|
|
14
|
+
save(snapshot: TSnapshot): void;
|
|
15
|
+
load(): TSnapshot | null;
|
|
16
|
+
clear(): void;
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=session-storage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-storage.d.ts","sourceRoot":"","sources":["../../src/shared/session-storage.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,SAAS;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,EACxE,GAAG,EAAE,MAAM;mBAGM,SAAS,GAAG,IAAI;YAWvB,SAAS,GAAG,IAAI;aAoBf,IAAI;EAOhB"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
/** A devtools capture store, as read off `window` by {@link useWindowStore}. */
|
|
3
|
+
export interface WindowStore<TState> {
|
|
4
|
+
getState: () => TState;
|
|
5
|
+
subscribe: (fn: (state: TState) => void) => () => void;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Resolves an in-page devtools store (set by an injected client on `window`)
|
|
9
|
+
* and mirrors its state into a reactive `shallowRef`. The custom-render panel
|
|
10
|
+
* runs in the same page context as the capture client, so it reads the store
|
|
11
|
+
* directly off `window` with no cross-frame crossing. Polls briefly when the
|
|
12
|
+
* panel opens before the first capture creates the store.
|
|
13
|
+
*
|
|
14
|
+
* @param readStore - Reads the store off `window`, or `undefined` if the client hasn't created it yet.
|
|
15
|
+
* @returns A reactive ref holding the latest state, or null until the store appears.
|
|
16
|
+
*/
|
|
17
|
+
export declare function useWindowStore<TState>(readStore: () => WindowStore<TState> | undefined): Ref<TState | null>;
|
|
18
|
+
//# sourceMappingURL=use-window-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-window-store.d.ts","sourceRoot":"","sources":["../../src/shared/use-window-store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAG9B,gFAAgF;AAChF,MAAM,WAAW,WAAW,CAAC,MAAM;IACjC,QAAQ,EAAE,MAAM,MAAM,CAAA;IACtB,SAAS,EAAE,CAAC,EAAE,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,KAAK,MAAM,IAAI,CAAA;CACvD;AAKD;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,MAAM,EACnC,SAAS,EAAE,MAAM,WAAW,CAAC,MAAM,CAAC,GAAG,SAAS,GAC/C,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC,CAkCpB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Plugin } from 'vite';
|
|
2
|
+
/**
|
|
3
|
+
* Creates the Vite plugin that registers the Storefront context devtools
|
|
4
|
+
* panel: a custom-render dock entry whose renderer mounts the Vue panel into
|
|
5
|
+
* the dock panel DOM. The panel has no capture client of its own; it reads
|
|
6
|
+
* the live Inertia page from the Inertia panel's capture store.
|
|
7
|
+
*/
|
|
8
|
+
export declare function createStorefrontPlugin(): Plugin;
|
|
9
|
+
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/storefront/plugin.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AASlC;;;;;GAKG;AACH,wBAAgB,sBAAsB,IAAI,MAAM,CAO/C"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { DockClientScriptContext } from '@vitejs/devtools-kit/client'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Custom-render entry that mounts a devtools panel's Vue app into the dock
|
|
5
|
+
* panel DOM via `mountPanel` (see `src/shared/mount-panel.ts`). The Vite
|
|
6
|
+
* DevTools dock imports this by module specifier at runtime. This
|
|
7
|
+
* hand-authored declaration is the typed contract shared by the `./inertia/renderer`,
|
|
8
|
+
* `./orpc/renderer`, and `./storefront/renderer` exports. The Vue UI each
|
|
9
|
+
* renderer mounts has no emittable types and is excluded from declaration
|
|
10
|
+
* generation.
|
|
11
|
+
*
|
|
12
|
+
* @param ctx - The dock client-script context provided by the Vite DevTools dock.
|
|
13
|
+
*/
|
|
14
|
+
declare function setupRenderer(ctx: DockClientScriptContext): void
|
|
15
|
+
|
|
16
|
+
export default setupRenderer
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { r as e, t } from "../../_chunks/panel-uV5ITqhY.mjs";
|
|
2
|
+
import { n } from "../../_chunks/useStore-Db8RZW8T.mjs";
|
|
3
|
+
import { computed as r, createElementBlock as i, createElementVNode as a, defineComponent as o, openBlock as s, toDisplayString as c } from "vue";
|
|
4
|
+
//#region src/storefront/panel/context-view.ts
|
|
5
|
+
function l(e) {
|
|
6
|
+
return typeof e == "object" && e && !Array.isArray(e) ? e : void 0;
|
|
7
|
+
}
|
|
8
|
+
function u(e) {
|
|
9
|
+
return typeof e == "string" ? e : void 0;
|
|
10
|
+
}
|
|
11
|
+
function d(e) {
|
|
12
|
+
return typeof e == "number" ? e : void 0;
|
|
13
|
+
}
|
|
14
|
+
function f(e) {
|
|
15
|
+
return typeof e == "boolean" ? e : void 0;
|
|
16
|
+
}
|
|
17
|
+
function p(e) {
|
|
18
|
+
let t = l(e);
|
|
19
|
+
return t ? Object.keys(t) : [];
|
|
20
|
+
}
|
|
21
|
+
function m(e) {
|
|
22
|
+
let t = l(e), n = l(t?.props), r = l(n?.storefront), i = l(r?.config), a = l(r?.country), o = l(i?.oauth), s = l(n?.user), c = l(a?.publicFields), m = Object.keys(c ?? {}).filter((e) => e !== "consentManagementRequired"), h = n?.availableCountries, g = n?.availableLanguages, _ = Array.isArray(s?.groups) ? s.groups.filter((e) => typeof e == "string") : [];
|
|
23
|
+
return {
|
|
24
|
+
tenantSpace: u(i?.tenantSpace),
|
|
25
|
+
shopKey: u(i?.shopKey),
|
|
26
|
+
domain: u(i?.domain),
|
|
27
|
+
oauthClientId: u(o?.clientId),
|
|
28
|
+
countryCode: u(a?.countryCode),
|
|
29
|
+
locale: u(a?.locale),
|
|
30
|
+
currency: u(a?.currency),
|
|
31
|
+
shopCountryId: d(a?.shopCountryId),
|
|
32
|
+
isDefault: f(a?.isDefault),
|
|
33
|
+
countrySelectorMode: u(i?.countrySelector),
|
|
34
|
+
availableCountriesCount: Array.isArray(h) ? h.length : void 0,
|
|
35
|
+
availableLanguagesCount: Array.isArray(g) ? g.length : void 0,
|
|
36
|
+
consentManagementRequired: f(c?.consentManagementRequired),
|
|
37
|
+
isLoggedIn: s !== void 0,
|
|
38
|
+
isGuest: f(s?.isGuest),
|
|
39
|
+
groups: _,
|
|
40
|
+
configPublicFieldKeys: p(i?.publicFields),
|
|
41
|
+
countryPublicFieldKeys: m,
|
|
42
|
+
pageVersion: u(t?.version),
|
|
43
|
+
currentUrl: u(t?.url)
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
//#endregion
|
|
47
|
+
//#region src/storefront/panel/App.vue?vue&type=script&setup=true&lang.ts
|
|
48
|
+
var h = { class: "sf-devtools" }, g = {
|
|
49
|
+
key: 0,
|
|
50
|
+
class: "sf-dt-empty"
|
|
51
|
+
}, _ = {
|
|
52
|
+
key: 1,
|
|
53
|
+
class: "sf-dt-context"
|
|
54
|
+
}, v = { class: "sf-dt-section" }, y = { class: "sf-dt-dl" }, b = { class: "sf-dt-col" }, x = { class: "sf-dt-section" }, S = { class: "sf-dt-dl" }, C = { class: "sf-dt-section" }, w = { class: "sf-dt-dl" }, T = "https://scayle.dev/documentation/storefront/storefront-application/getting-started/what-is-storefront", E = /*#__PURE__*/ t(/* @__PURE__ */ o({
|
|
55
|
+
__name: "App",
|
|
56
|
+
setup(e) {
|
|
57
|
+
let t = n(), o = r(() => t.value !== null), l = r(() => m(t.value?.currentPage ?? null));
|
|
58
|
+
function u(e) {
|
|
59
|
+
return e === void 0 ? "—" : e ? "yes" : "no";
|
|
60
|
+
}
|
|
61
|
+
function d(e) {
|
|
62
|
+
return e === void 0 ? "—" : String(e);
|
|
63
|
+
}
|
|
64
|
+
function f(e) {
|
|
65
|
+
return e.length ? e.join(", ") : "none";
|
|
66
|
+
}
|
|
67
|
+
return (e, t) => (s(), i("div", h, [a("nav", { class: "sf-dt-tabs" }, [t[0] ||= a("span", { class: "sf-dt-tab is-active" }, "Context", -1), a("a", {
|
|
68
|
+
class: "sf-dt-tab sf-dt-doclink",
|
|
69
|
+
href: T,
|
|
70
|
+
target: "_blank",
|
|
71
|
+
rel: "noreferrer"
|
|
72
|
+
}, " Storefront docs ")]), o.value ? (s(), i("div", _, [a("section", v, [t[14] ||= a("h4", { class: "sf-dt-heading" }, "Shop & Locale", -1), a("dl", y, [
|
|
73
|
+
t[1] ||= a("dt", null, "Tenant space", -1),
|
|
74
|
+
a("dd", null, c(d(l.value.tenantSpace)), 1),
|
|
75
|
+
t[2] ||= a("dt", null, "Shop key", -1),
|
|
76
|
+
a("dd", null, c(d(l.value.shopKey)), 1),
|
|
77
|
+
t[3] ||= a("dt", null, "Domain", -1),
|
|
78
|
+
a("dd", null, c(d(l.value.domain)), 1),
|
|
79
|
+
t[4] ||= a("dt", null, "Country", -1),
|
|
80
|
+
a("dd", null, c(d(l.value.countryCode)), 1),
|
|
81
|
+
t[5] ||= a("dt", null, "Locale", -1),
|
|
82
|
+
a("dd", null, c(d(l.value.locale)), 1),
|
|
83
|
+
t[6] ||= a("dt", null, "Currency", -1),
|
|
84
|
+
a("dd", null, c(d(l.value.currency)), 1),
|
|
85
|
+
t[7] ||= a("dt", null, "Shop-country ID", -1),
|
|
86
|
+
a("dd", null, c(d(l.value.shopCountryId)), 1),
|
|
87
|
+
t[8] ||= a("dt", null, "Default country", -1),
|
|
88
|
+
a("dd", null, c(u(l.value.isDefault)), 1),
|
|
89
|
+
t[9] ||= a("dt", null, "Country selector", -1),
|
|
90
|
+
a("dd", null, c(d(l.value.countrySelectorMode)), 1),
|
|
91
|
+
t[10] ||= a("dt", null, "Available countries", -1),
|
|
92
|
+
a("dd", null, c(d(l.value.availableCountriesCount)), 1),
|
|
93
|
+
t[11] ||= a("dt", null, "Available languages", -1),
|
|
94
|
+
a("dd", null, c(d(l.value.availableLanguagesCount)), 1),
|
|
95
|
+
t[12] ||= a("dt", null, "Consent required", -1),
|
|
96
|
+
a("dd", null, c(u(l.value.consentManagementRequired)), 1),
|
|
97
|
+
t[13] ||= a("dt", null, "OAuth client ID", -1),
|
|
98
|
+
a("dd", null, c(d(l.value.oauthClientId)), 1)
|
|
99
|
+
])]), a("div", b, [a("section", x, [t[18] ||= a("h4", { class: "sf-dt-heading" }, "Session", -1), a("dl", S, [
|
|
100
|
+
t[15] ||= a("dt", null, "Logged in", -1),
|
|
101
|
+
a("dd", null, c(u(l.value.isLoggedIn)), 1),
|
|
102
|
+
t[16] ||= a("dt", null, "Guest", -1),
|
|
103
|
+
a("dd", null, c(u(l.value.isGuest)), 1),
|
|
104
|
+
t[17] ||= a("dt", null, "Groups", -1),
|
|
105
|
+
a("dd", null, c(f(l.value.groups)), 1)
|
|
106
|
+
])]), a("section", C, [t[23] ||= a("h4", { class: "sf-dt-heading" }, "Page", -1), a("dl", w, [
|
|
107
|
+
t[19] ||= a("dt", null, "Current URL", -1),
|
|
108
|
+
a("dd", null, c(d(l.value.currentUrl)), 1),
|
|
109
|
+
t[20] ||= a("dt", null, "Page version", -1),
|
|
110
|
+
a("dd", null, c(d(l.value.pageVersion)), 1),
|
|
111
|
+
t[21] ||= a("dt", null, "Config public fields", -1),
|
|
112
|
+
a("dd", null, c(f(l.value.configPublicFieldKeys)), 1),
|
|
113
|
+
t[22] ||= a("dt", null, "Country public fields", -1),
|
|
114
|
+
a("dd", null, c(f(l.value.countryPublicFieldKeys)), 1)
|
|
115
|
+
])])])])) : (s(), i("div", g, " Enable the Inertia panel to inspect Storefront context. "))]));
|
|
116
|
+
}
|
|
117
|
+
}), [["__scopeId", "data-v-1afb26c2"]]);
|
|
118
|
+
//#endregion
|
|
119
|
+
//#region src/storefront/panel/renderer.ts
|
|
120
|
+
function D(t) {
|
|
121
|
+
e(t, E);
|
|
122
|
+
}
|
|
123
|
+
//#endregion
|
|
124
|
+
export { D as default };
|