@sxl-studio/storybook-addon 1.0.3 → 1.0.4

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.
Files changed (2) hide show
  1. package/dist/manager.js +16 -7
  2. package/package.json +1 -1
package/dist/manager.js CHANGED
@@ -1,6 +1,5 @@
1
1
  // src/manager.tsx
2
2
  import { addons, types } from "@storybook/manager-api";
3
- import { AddonPanel } from "@storybook/components";
4
3
 
5
4
  // src/constants.ts
6
5
  var ADDON_ID = "sxl-studio";
@@ -307,10 +306,20 @@ var SxlPanel = () => {
307
306
 
308
307
  // src/manager.tsx
309
308
  import { jsx as jsx2 } from "react/jsx-runtime";
310
- addons.register(ADDON_ID, () => {
311
- addons.add(PANEL_ID, {
312
- type: types.PANEL,
313
- title: "SXL Studio",
314
- render: ({ active }) => /* @__PURE__ */ jsx2(AddonPanel, { active: active ?? false, children: /* @__PURE__ */ jsx2(SxlPanel, {}) })
309
+ var REGISTRY_GUARD_KEY = "__sxlStudioAddonRegistered__";
310
+ if (!globalThis[REGISTRY_GUARD_KEY]) {
311
+ globalThis[REGISTRY_GUARD_KEY] = true;
312
+ console.info("[SXL Storybook Addon] register manager addon");
313
+ addons.register(ADDON_ID, () => {
314
+ addons.add(PANEL_ID, {
315
+ type: types.PANEL,
316
+ title: "SXL Studio",
317
+ render: ({ active }) => {
318
+ if (!active) return null;
319
+ return /* @__PURE__ */ jsx2(SxlPanel, {});
320
+ }
321
+ });
315
322
  });
316
- });
323
+ } else {
324
+ console.warn("[SXL Storybook Addon] skip duplicate manager registration");
325
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sxl-studio/storybook-addon",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "Storybook addon for SXL Studio — displays Figma Embed, component info and design token status for linked components",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",