@zedtech/zedkit-devtools 0.0.0-stage → 0.2.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/LICENSE +21 -0
- package/README.md +4 -2
- package/dist/enabled.d.ts +7 -0
- package/dist/enabled.d.ts.map +1 -0
- package/dist/enabled.js +7 -0
- package/dist/enabled.js.map +1 -0
- package/dist/flag-overrides-tab.d.ts +5 -0
- package/dist/flag-overrides-tab.d.ts.map +1 -0
- package/dist/flag-overrides-tab.js +24 -0
- package/dist/flag-overrides-tab.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/panel-shell.d.ts +8 -0
- package/dist/panel-shell.d.ts.map +1 -0
- package/dist/panel-shell.js +10 -0
- package/dist/panel-shell.js.map +1 -0
- package/dist/panel-tabs.d.ts +18 -0
- package/dist/panel-tabs.d.ts.map +1 -0
- package/dist/panel-tabs.js +20 -0
- package/dist/panel-tabs.js.map +1 -0
- package/dist/panel-types.d.ts +18 -0
- package/dist/panel-types.d.ts.map +1 -0
- package/dist/panel-types.js +2 -0
- package/dist/panel-types.js.map +1 -0
- package/dist/panel.d.ts +4 -0
- package/dist/panel.d.ts.map +1 -0
- package/dist/panel.js +13 -0
- package/dist/panel.js.map +1 -0
- package/dist/react.d.ts +10 -0
- package/dist/react.d.ts.map +1 -0
- package/dist/react.js +12 -0
- package/dist/react.js.map +1 -0
- package/package.json +70 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 zedtech-fr
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @zedtech/zedkit-devtools
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Dev-only drawer built on `@zedtech/zedkit-ui` (and flag overrides via `@zedtech/zedkit-flags`). See [CATALOG.md](./CATALOG.md).
|
|
4
|
+
|
|
5
|
+
Original work by the same author.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type DevtoolsEnabledOptions = {
|
|
2
|
+
/** When true, mount even if `NODE_ENV` is production (local demos only). */
|
|
3
|
+
force?: boolean;
|
|
4
|
+
nodeEnv?: string | undefined;
|
|
5
|
+
};
|
|
6
|
+
export declare function devtoolsEnabled(options?: DevtoolsEnabledOptions): boolean;
|
|
7
|
+
//# sourceMappingURL=enabled.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enabled.d.ts","sourceRoot":"","sources":["../src/enabled.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,sBAAsB,GAAG;IACnC,4EAA4E;IAC5E,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC9B,CAAC;AAEF,wBAAgB,eAAe,CAAC,OAAO,GAAE,sBAA2B,GAAG,OAAO,CAI7E"}
|
package/dist/enabled.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enabled.js","sourceRoot":"","sources":["../src/enabled.ts"],"names":[],"mappings":"AAMA,MAAM,UAAU,eAAe,CAAC,UAAkC,EAAE;IAClE,IAAI,OAAO,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IAC/B,MAAM,GAAG,GAAG,OAAO,CAAC,OAAO,IAAI,CAAC,OAAO,OAAO,KAAK,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IACnG,OAAO,GAAG,KAAK,YAAY,CAAC;AAC9B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flag-overrides-tab.d.ts","sourceRoot":"","sources":["../src/flag-overrides-tab.tsx"],"names":[],"mappings":"AAMA,MAAM,MAAM,qBAAqB,GAAG;IAClC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;CAC7B,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,EAAE,QAAQ,EAAE,EAAE,qBAAqB,+BAmCnE"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect, useState } from "react";
|
|
4
|
+
import { Label, Stack, Switch, Text } from "@zedtech/zedkit-ui";
|
|
5
|
+
import { readFlagOverrides, subscribeFlagOverrides, writeFlagOverride } from "@zedtech/zedkit-flags";
|
|
6
|
+
export function FlagOverridesTab({ flagKeys }) {
|
|
7
|
+
const [overrides, setOverrides] = useState(() => readFlagOverrides(typeof localStorage === "undefined" ? null : localStorage));
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
return subscribeFlagOverrides(() => {
|
|
10
|
+
setOverrides(readFlagOverrides(typeof localStorage === "undefined" ? null : localStorage));
|
|
11
|
+
});
|
|
12
|
+
}, []);
|
|
13
|
+
if (flagKeys.length === 0) {
|
|
14
|
+
return _jsx(Text, { variant: "muted", children: "Pass `flagKeys` to override flags in local storage." });
|
|
15
|
+
}
|
|
16
|
+
return (_jsx(Stack, { gap: 3, children: flagKeys.map((key) => {
|
|
17
|
+
const on = key in overrides ? Boolean(overrides[key]) : false;
|
|
18
|
+
const id = `devtools-flag-${key}`;
|
|
19
|
+
return (_jsxs(Stack, { direction: "horizontal", gap: 2, className: "items-center justify-between", children: [_jsx(Label, { htmlFor: id, children: key }), _jsx(Switch, { id: id, checked: on, onCheckedChange: (checked) => {
|
|
20
|
+
writeFlagOverride(localStorage, key, checked ? true : false);
|
|
21
|
+
} })] }, key));
|
|
22
|
+
}) }));
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=flag-overrides-tab.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flag-overrides-tab.js","sourceRoot":"","sources":["../src/flag-overrides-tab.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAMrG,MAAM,UAAU,gBAAgB,CAAC,EAAE,QAAQ,EAAyB;IAClE,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,GAAG,EAAE,CAC9C,iBAAiB,CAAC,OAAO,YAAY,KAAK,W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d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,KAAK,sBAAsB,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAA+B,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export declare function DevtoolsDrawerShell({ triggerLabel, children, footer, }: {
|
|
3
|
+
triggerLabel: string;
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
footer?: ReactNode;
|
|
6
|
+
}): import("react").JSX.Element;
|
|
7
|
+
export declare function DevtoolsDrawerFooter(): import("react").JSX.Element;
|
|
8
|
+
//# sourceMappingURL=panel-shell.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"panel-shell.d.ts","sourceRoot":"","sources":["../src/panel-shell.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAevC,wBAAgB,mBAAmB,CAAC,EAClC,YAAY,EACZ,QAAQ,EACR,MAAM,GACP,EAAE;IACD,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,SAAS,CAAC;IACpB,MAAM,CAAC,EAAE,SAAS,CAAC;CACpB,+BAqBA;AAED,wBAAgB,oBAAoB,gCAMnC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Button, Drawer, DrawerBody, DrawerContent, DrawerDescription, DrawerFooter, DrawerHandle, DrawerHeader, DrawerTitle, DrawerTrigger, Text, } from "@zedtech/zedkit-ui";
|
|
4
|
+
export function DevtoolsDrawerShell({ triggerLabel, children, footer, }) {
|
|
5
|
+
return (_jsx("div", { className: "fixed bottom-4 left-4 z-50", children: _jsxs(Drawer, { children: [_jsx(DrawerTrigger, { asChild: true, children: _jsx(Button, { type: "button", size: "sm", variant: "secondary", children: triggerLabel }) }), _jsxs(DrawerContent, { children: [_jsx(DrawerHandle, {}), _jsxs(DrawerHeader, { children: [_jsx(DrawerTitle, { children: "Developer tools" }), _jsx(DrawerDescription, { children: "Local-only controls. Tree-shake this panel out of production builds." })] }), _jsx(DrawerBody, { children: children }), footer ? _jsx(DrawerFooter, { children: footer }) : null] })] }) }));
|
|
6
|
+
}
|
|
7
|
+
export function DevtoolsDrawerFooter() {
|
|
8
|
+
return (_jsx(Text, { variant: "muted", className: "text-sm", children: "Not shown when `devtoolsEnabled()` is false." }));
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=panel-shell.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"panel-shell.js","sourceRoot":"","sources":["../src/panel-shell.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EACL,MAAM,EACN,MAAM,EACN,UAAU,EACV,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,aAAa,EACb,IAAI,GACL,MAAM,oBAAoB,CAAC;AAE5B,MAAM,UAAU,mBAAmB,CAAC,EAClC,YAAY,EACZ,QAAQ,EACR,MAAM,GAKP;IACC,OAAO,CACL,cAAK,SAAS,EAAC,4BAA4B,YACzC,MAAC,MAAM,eACL,KAAC,aAAa,IAAC,OAAO,kBACpB,KAAC,MAAM,IAAC,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAC,IAAI,EAAC,OAAO,EAAC,WAAW,YAChD,YAAY,GACN,GACK,EAChB,MAAC,aAAa,eACZ,KAAC,YAAY,KAAG,EAChB,MAAC,YAAY,eACX,KAAC,WAAW,kCAA8B,EAC1C,KAAC,iBAAiB,uFAAyF,IAC9F,EACf,KAAC,UAAU,cAAE,QAAQ,GAAc,EAClC,MAAM,CAAC,CAAC,CAAC,KAAC,YAAY,cAAE,MAAM,GAAgB,CAAC,CAAC,CAAC,IAAI,IACxC,IACT,GACL,CACP,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,oBAAoB;IAClC,OAAO,CACL,KAAC,IAAI,IAAC,OAAO,EAAC,OAAO,EAAC,SAAS,EAAC,SAAS,6DAElC,CACR,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { DevtoolsBuildInfoRow, DevtoolsLocaleOption } from "./panel-types.js";
|
|
3
|
+
export declare function LookTab(): import("react").JSX.Element;
|
|
4
|
+
export declare function FlagsTabContent({ flagKeys }: {
|
|
5
|
+
flagKeys: readonly string[];
|
|
6
|
+
}): import("react").JSX.Element;
|
|
7
|
+
export declare function LocaleTabContent({ localeOptions, activeLocale, onLocaleChange, }: {
|
|
8
|
+
localeOptions: readonly DevtoolsLocaleOption[];
|
|
9
|
+
activeLocale?: string | undefined;
|
|
10
|
+
onLocaleChange: (localeId: string) => void;
|
|
11
|
+
}): import("react").JSX.Element;
|
|
12
|
+
export declare function InfoTabContent({ buildInfo }: {
|
|
13
|
+
buildInfo: readonly DevtoolsBuildInfoRow[];
|
|
14
|
+
}): import("react").JSX.Element;
|
|
15
|
+
export declare function QueryTabContent({ querySlot }: {
|
|
16
|
+
querySlot: ReactNode;
|
|
17
|
+
}): import("react").JSX.Element;
|
|
18
|
+
//# sourceMappingURL=panel-tabs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"panel-tabs.d.ts","sourceRoot":"","sources":["../src/panel-tabs.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,OAAO,KAAK,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAEnF,wBAAgB,OAAO,gCAEtB;AAED,wBAAgB,eAAe,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,+BAM5E;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,aAAa,EACb,YAAY,EACZ,cAAc,GACf,EAAE;IACD,aAAa,EAAE,SAAS,oBAAoB,EAAE,CAAC;IAC/C,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,cAAc,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;CAC5C,+BAoBA;AAED,wBAAgB,cAAc,CAAC,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,EAAE,SAAS,oBAAoB,EAAE,CAAA;CAAE,+BAa3F;AAED,wBAAgB,eAAe,CAAC,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,EAAE,SAAS,CAAA;CAAE,+BAEtE"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { IdentitySwitcher, Label, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, Stack, TabsContent, Text } from "@zedtech/zedkit-ui";
|
|
4
|
+
import { FlagOverridesTab } from "./flag-overrides-tab.js";
|
|
5
|
+
export function LookTab() {
|
|
6
|
+
return _jsx(IdentitySwitcher, { showLabel: true, label: "Identity" });
|
|
7
|
+
}
|
|
8
|
+
export function FlagsTabContent({ flagKeys }) {
|
|
9
|
+
return (_jsx(TabsContent, { value: "flags", children: _jsx(FlagOverridesTab, { flagKeys: flagKeys }) }));
|
|
10
|
+
}
|
|
11
|
+
export function LocaleTabContent({ localeOptions, activeLocale, onLocaleChange, }) {
|
|
12
|
+
return (_jsx(TabsContent, { value: "locale", children: _jsxs(Stack, { gap: 2, children: [_jsx(Label, { htmlFor: "devtools-locale", children: "Messages locale" }), _jsxs(Select, { value: activeLocale, onValueChange: onLocaleChange, children: [_jsx(SelectTrigger, { id: "devtools-locale", children: _jsx(SelectValue, { placeholder: "Choose locale" }) }), _jsx(SelectContent, { children: localeOptions.map((option) => (_jsx(SelectItem, { value: option.id, children: option.label }, option.id))) })] })] }) }));
|
|
13
|
+
}
|
|
14
|
+
export function InfoTabContent({ buildInfo }) {
|
|
15
|
+
return (_jsx(TabsContent, { value: "info", children: _jsx(Stack, { gap: 2, children: buildInfo.map((row) => (_jsxs(Stack, { direction: "horizontal", gap: 2, className: "items-center justify-between text-sm", children: [_jsx(Text, { variant: "muted", children: row.label }), _jsx(Text, { children: row.value })] }, row.label))) }) }));
|
|
16
|
+
}
|
|
17
|
+
export function QueryTabContent({ querySlot }) {
|
|
18
|
+
return _jsx(TabsContent, { value: "query", children: querySlot });
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=panel-tabs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"panel-tabs.js","sourceRoot":"","sources":["../src/panel-tabs.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,aAAa,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAEtJ,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAG3D,MAAM,UAAU,OAAO;IACrB,OAAO,KAAC,gBAAgB,IAAC,SAAS,QAAC,KAAK,EAAC,UAAU,GAAG,CAAC;AACzD,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,EAAE,QAAQ,EAAmC;IAC3E,OAAO,CACL,KAAC,WAAW,IAAC,KAAK,EAAC,OAAO,YACxB,KAAC,gBAAgB,IAAC,QAAQ,EAAE,QAAQ,GAAI,GAC5B,CACf,CAAC;AACJ,CAAC;AAED,MAAM,UAA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CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type DevtoolsBuildInfoRow = {
|
|
2
|
+
label: string;
|
|
3
|
+
value: string;
|
|
4
|
+
};
|
|
5
|
+
export type DevtoolsLocaleOption = {
|
|
6
|
+
id: string;
|
|
7
|
+
label: string;
|
|
8
|
+
};
|
|
9
|
+
export type ZedkitDevtoolsPanelProps = {
|
|
10
|
+
flagKeys?: readonly string[];
|
|
11
|
+
buildInfo?: readonly DevtoolsBuildInfoRow[];
|
|
12
|
+
localeOptions?: readonly DevtoolsLocaleOption[];
|
|
13
|
+
activeLocale?: string;
|
|
14
|
+
onLocaleChange?: (localeId: string) => void;
|
|
15
|
+
querySlot?: import("react").ReactNode;
|
|
16
|
+
triggerLabel?: string;
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=panel-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"panel-types.d.ts","sourceRoot":"","sources":["../src/panel-types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,oBAAoB,GAAG;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACrC,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC7B,SAAS,CAAC,EAAE,SAAS,oBAAoB,EAAE,CAAC;IAC5C,aAAa,CAAC,EAAE,SAAS,oBAAoB,EAAE,CAAC;IAChD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,SAAS,CAAC,EAAE,OAAO,OAAO,EAAE,SAAS,CAAC;IACtC,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"panel-types.js","sourceRoot":"","sources":["../src/panel-types.ts"],"names":[],"mappings":""}
|
package/dist/panel.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ZedkitDevtoolsPanelProps } from "./panel-types.js";
|
|
2
|
+
export type { DevtoolsBuildInfoRow, DevtoolsLocaleOption, ZedkitDevtoolsPanelProps } from "./panel-types.js";
|
|
3
|
+
export declare function ZedkitDevtoolsPanel({ flagKeys, buildInfo, localeOptions, activeLocale, onLocaleChange, querySlot, triggerLabel, }: ZedkitDevtoolsPanelProps): import("react").JSX.Element;
|
|
4
|
+
//# sourceMappingURL=panel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"panel.d.ts","sourceRoot":"","sources":["../src/panel.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAEjE,YAAY,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAE7G,wBAAgB,mBAAmB,CAAC,EAClC,QAAa,EACb,SAAc,EACd,aAAkB,EAClB,YAAY,EACZ,cAAc,EACd,SAAS,EACT,YAAoB,GACrB,EAAE,wBAAwB,+BA4B1B"}
|
package/dist/panel.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@zedtech/zedkit-ui";
|
|
4
|
+
import { DevtoolsDrawerFooter, DevtoolsDrawerShell } from "./panel-shell.js";
|
|
5
|
+
import { FlagsTabContent, InfoTabContent, LocaleTabContent, LookTab, QueryTabContent } from "./panel-tabs.js";
|
|
6
|
+
export function ZedkitDevtoolsPanel({ flagKeys = [], buildInfo = [], localeOptions = [], activeLocale, onLocaleChange, querySlot, triggerLabel = "Dev", }) {
|
|
7
|
+
const showFlags = flagKeys.length > 0;
|
|
8
|
+
const showLocale = localeOptions.length > 0 && onLocaleChange;
|
|
9
|
+
const showQuery = Boolean(querySlot);
|
|
10
|
+
const showInfo = buildInfo.length > 0;
|
|
11
|
+
return (_jsx(DevtoolsDrawerShell, { triggerLabel: triggerLabel, footer: _jsx(DevtoolsDrawerFooter, {}), children: _jsxs(Tabs, { defaultValue: "look", children: [_jsxs(TabsList, { className: "mb-3 flex flex-wrap", children: [_jsx(TabsTrigger, { value: "look", children: "Look" }), showFlags ? _jsx(TabsTrigger, { value: "flags", children: "Flags" }) : null, showLocale ? _jsx(TabsTrigger, { value: "locale", children: "Locale" }) : null, showInfo ? _jsx(TabsTrigger, { value: "info", children: "Info" }) : null, showQuery ? _jsx(TabsTrigger, { value: "query", children: "Query" }) : null] }), _jsx(TabsContent, { value: "look", children: _jsx(LookTab, {}) }), showFlags ? _jsx(FlagsTabContent, { flagKeys: flagKeys }) : null, showLocale ? (_jsx(LocaleTabContent, { localeOptions: localeOptions, activeLocale: activeLocale, onLocaleChange: onLocaleChange })) : null, showInfo ? _jsx(InfoTabContent, { buildInfo: buildInfo }) : null, showQuery && querySlot ? _jsx(QueryTabContent, { querySlot: querySlot }) : null] }) }));
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=panel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"panel.js","sourceRoot":"","sources":["../src/panel.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAE9E,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,gBAAgB,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAK9G,MAAM,U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AC,CAAC,CACZ,KAAC,gBAAgB,IAAC,aAAa,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,cAAc,GAAI,CAC/G,CAAC,CAAC,CAAC,IAAI,EACP,QAAQ,CAAC,CAAC,CAAC,KAAC,cAAc,IAAC,SAAS,EAAE,SAAS,GAAI,CAAC,CAAC,CAAC,IAAI,EAC1D,SAAS,IAAI,SAAS,CAAC,CAAC,CAAC,KAAC,eAAe,IAAC,SAAS,EAAE,SAAS,GAAI,CAAC,CAAC,CAAC,IAAI,IACrE,GACa,CACvB,CAAC;AACJ,CAAC"}
|
package/dist/react.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { type ZedkitDevtoolsPanelProps } from "./panel.js";
|
|
3
|
+
export type ZedkitDevtoolsProps = ZedkitDevtoolsPanelProps & {
|
|
4
|
+
enabled?: boolean;
|
|
5
|
+
force?: boolean;
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
};
|
|
8
|
+
export declare function ZedkitDevtools({ enabled, force, children, ...panel }: ZedkitDevtoolsProps): string | number | bigint | boolean | import("react").JSX.Element | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | null;
|
|
9
|
+
export { ZedkitDevtoolsPanel, type DevtoolsBuildInfoRow, type DevtoolsLocaleOption, type ZedkitDevtoolsPanelProps } from "./panel.js";
|
|
10
|
+
//# sourceMappingURL=react.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../src/react.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,EAAuB,KAAK,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAEhF,MAAM,MAAM,mBAAmB,GAAG,wBAAwB,GAAG;IAC3D,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC;AAEF,wBAAgB,cAAc,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,mBAAmB,mTASzF;AAED,OAAO,EAAE,mBAAmB,EAAE,KAAK,oBAAoB,EAAE,KAAK,oBAAoB,EAAE,KAAK,wBAAwB,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/react.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { devtoolsEnabled } from "./enabled.js";
|
|
4
|
+
import { ZedkitDevtoolsPanel } from "./panel.js";
|
|
5
|
+
export function ZedkitDevtools({ enabled, force, children, ...panel }) {
|
|
6
|
+
const show = enabled ?? devtoolsEnabled(force ? { force: true } : {});
|
|
7
|
+
if (!show)
|
|
8
|
+
return children ?? null;
|
|
9
|
+
return (_jsxs(_Fragment, { children: [children, _jsx(ZedkitDevtoolsPanel, { ...panel })] }));
|
|
10
|
+
}
|
|
11
|
+
export { ZedkitDevtoolsPanel } from "./panel.js";
|
|
12
|
+
//# sourceMappingURL=react.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react.js","sourceRoot":"","sources":["../src/react.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAIb,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAiC,MAAM,YAAY,CAAC;AAQhF,MAAM,UAAU,cAAc,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAuB;IACxF,MAAM,IAAI,GAAG,OAAO,IAAI,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IACtE,IAAI,CAAC,IAAI;QAAE,OAAO,QAAQ,IAAI,IAAI,CAAC;IACnC,OAAO,CACL,8BACG,QAAQ,EACT,KAAC,mBAAmB,OAAK,KAAK,GAAI,IACjC,CACJ,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,mBAAmB,EAAuF,MAAM,YAAY,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,73 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zedtech/zedkit-devtools",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
|
|
3
|
+
"version": "0.2.1",
|
|
4
|
+
"publishConfig": {
|
|
5
|
+
"access": "public",
|
|
6
|
+
"registry": "https://registry.npmjs.org/"
|
|
7
|
+
},
|
|
8
|
+
"description": "Dev-only drawer for identity, flag overrides, locale switching, build info, and a query devtools slot. Original work by the same author.",
|
|
9
|
+
"keywords": [
|
|
10
|
+
"devtools",
|
|
11
|
+
"development",
|
|
12
|
+
"react",
|
|
13
|
+
"typescript",
|
|
14
|
+
"debug"
|
|
15
|
+
],
|
|
16
|
+
"homepage": "https://github.com/zedtech-fr/zedkit/tree/main/packages/devtools",
|
|
17
|
+
"bugs": {
|
|
18
|
+
"url": "https://github.com/zedtech-fr/zedkit/issues"
|
|
19
|
+
},
|
|
20
|
+
"license": "MIT",
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "https://github.com/zedtech-fr/zedkit",
|
|
24
|
+
"directory": "packages/devtools"
|
|
25
|
+
},
|
|
26
|
+
"type": "module",
|
|
27
|
+
"sideEffects": false,
|
|
28
|
+
"imports": {
|
|
29
|
+
"#*": "./src/*"
|
|
30
|
+
},
|
|
31
|
+
"main": "./dist/index.js",
|
|
32
|
+
"types": "./dist/index.d.ts",
|
|
33
|
+
"exports": {
|
|
34
|
+
".": {
|
|
35
|
+
"types": "./dist/index.d.ts",
|
|
36
|
+
"import": "./dist/index.js"
|
|
37
|
+
},
|
|
38
|
+
"./react": {
|
|
39
|
+
"types": "./dist/react.d.ts",
|
|
40
|
+
"import": "./dist/react.js"
|
|
41
|
+
},
|
|
42
|
+
"./package.json": "./package.json"
|
|
43
|
+
},
|
|
44
|
+
"files": [
|
|
45
|
+
"dist"
|
|
46
|
+
],
|
|
47
|
+
"peerDependencies": {
|
|
48
|
+
"react": "19.3.1",
|
|
49
|
+
"react-dom": "19.3.1",
|
|
50
|
+
"@zedtech/zedkit-flags": "0.2.1",
|
|
51
|
+
"@zedtech/zedkit-ui": "0.7.1"
|
|
52
|
+
},
|
|
53
|
+
"devDependencies": {
|
|
54
|
+
"@testing-library/react": "16.3.3",
|
|
55
|
+
"@types/node": "26.6.5",
|
|
56
|
+
"@types/react": "19.3.0",
|
|
57
|
+
"@types/react-dom": "19.3.0",
|
|
58
|
+
"jsdom": "30.1.3",
|
|
59
|
+
"react": "19.3.1",
|
|
60
|
+
"react-dom": "19.3.1",
|
|
61
|
+
"typescript": "5.9.3",
|
|
62
|
+
"vitest": "5.0.5",
|
|
63
|
+
"@zedtech/zedkit-flags": "0.2.1",
|
|
64
|
+
"@zedtech/zedkit-ui": "0.7.1",
|
|
65
|
+
"@zedtech/zedkit-quality": "0.5.0"
|
|
66
|
+
},
|
|
67
|
+
"scripts": {
|
|
68
|
+
"build": "tsc -p tsconfig.json",
|
|
69
|
+
"test": "vitest run && node --test tests/enabled.test.mjs",
|
|
70
|
+
"typecheck": "tsc --noEmit -p tsconfig.tests.json",
|
|
71
|
+
"lint": "eslint src tests"
|
|
72
|
+
}
|
|
6
73
|
}
|