@storybook/addon-onboarding 0.0.0-pr-30601-sha-d70f67e1 → 0.0.0-pr-31819-sha-b1c88d51

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.
@@ -0,0 +1,7 @@
1
+ // src/constants.ts
2
+ var O = "STORYBOOK_ADDON_ONBOARDING_CHANNEL", o = "addon-controls";
3
+
4
+ export {
5
+ O as a,
6
+ o as b
7
+ };
@@ -0,0 +1,27 @@
1
+ var g = Object.create;
2
+ var e = Object.defineProperty;
3
+ var h = Object.getOwnPropertyDescriptor;
4
+ var i = Object.getOwnPropertyNames;
5
+ var j = Object.getPrototypeOf, k = Object.prototype.hasOwnProperty;
6
+ var m = (b, a) => e(b, "name", { value: a, configurable: !0 });
7
+ var n = (b, a) => () => (a || b((a = { exports: {} }).exports, a), a.exports);
8
+ var l = (b, a, c, f) => {
9
+ if (a && typeof a == "object" || typeof a == "function")
10
+ for (let d of i(a))
11
+ !k.call(b, d) && d !== c && e(b, d, { get: () => a[d], enumerable: !(f = h(a, d)) || f.enumerable });
12
+ return b;
13
+ };
14
+ var o = (b, a, c) => (c = b != null ? g(j(b)) : {}, l(
15
+ // If the importer is in node compatibility mode or this is not an ESM
16
+ // file that has been converted to a CommonJS file using a Babel-
17
+ // compatible transform (i.e. "__esModule" has not been set), then set
18
+ // "default" to the CommonJS "module.exports" for node compatibility.
19
+ a || !b || !b.__esModule ? e(c, "default", { value: b, enumerable: !0 }) : c,
20
+ b
21
+ ));
22
+
23
+ export {
24
+ m as a,
25
+ n as b,
26
+ o as c
27
+ };
package/dist/index.js CHANGED
@@ -1,5 +1,7 @@
1
- 'use strict';
1
+ import "./_browser-chunks/chunk-J5TRTLII.js";
2
2
 
3
- var index_default={};
4
-
5
- module.exports = index_default;
3
+ // src/index.ts
4
+ var e = {};
5
+ export {
6
+ e as default
7
+ };
package/dist/manager.js CHANGED
@@ -1,7 +1,30 @@
1
- import React, { lazy, Suspense } from 'react';
2
- import ReactDOM from 'react-dom';
3
- import { ADDON_ID } from 'storybook/internal/controls';
4
- import { STORY_SPECIFIED } from 'storybook/internal/core-events';
5
- import { addons } from 'storybook/manager-api';
1
+ import {
2
+ b as r
3
+ } from "./_browser-chunks/chunk-HTQMOF6O.js";
4
+ import "./_browser-chunks/chunk-J5TRTLII.js";
6
5
 
7
- var Onboarding=lazy(()=>import('./Onboarding-C2PY5T7U.js'));addons.register("@storybook/addon-onboarding",async api=>{let urlState=api.getUrlState(),isOnboarding=urlState.path==="/onboarding"||urlState.queryParams.onboarding==="true";api.once(STORY_SPECIFIED,()=>{if(!(!!api.getData("example-button--primary")||!!document.getElementById("example-button--primary"))){console.warn("[@storybook/addon-onboarding] It seems like you have finished the onboarding experience in Storybook! Therefore this addon is not necessary anymore and will not be loaded. You are free to remove it from your project. More info: https://github.com/storybookjs/storybook/tree/next/code/addons/onboarding#uninstalling");return}if(!isOnboarding||window.innerWidth<730)return;api.togglePanel(!0),api.togglePanelPosition("bottom"),api.setSelectedPanel(ADDON_ID);let domNode=document.createElement("div");domNode.id="storybook-addon-onboarding",document.body.appendChild(domNode),ReactDOM.render(React.createElement(Suspense,{fallback:React.createElement("div",null)},React.createElement(Onboarding,{api})),domNode);});});
6
+ // src/manager.tsx
7
+ import n, { Suspense as i, lazy as a } from "react";
8
+ import s from "react-dom";
9
+ import { STORY_SPECIFIED as m } from "storybook/internal/core-events";
10
+ import { addons as l } from "storybook/manager-api";
11
+ var b = a(() => import("./_browser-chunks/Onboarding-YLDFOYKQ.js"));
12
+ l.register("@storybook/addon-onboarding", async (o) => {
13
+ let t = o.getUrlState(), d = t.path === "/onboarding" || t.queryParams.onboarding === "true";
14
+ o.once(m, () => {
15
+ if (!(!!o.getData("example-button--primary") || !!document.getElementById("example-button--primary"))) {
16
+ console.warn(
17
+ "[@storybook/addon-onboarding] It seems like you have finished the onboarding experience in Storybook! Therefore this addon is not necessary anymore and will not be loaded. You are free to remove it from your project. More info: https://github.com/storybookjs/storybook/tree/next/code/addons/onboarding#uninstalling"
18
+ );
19
+ return;
20
+ }
21
+ if (!d || window.innerWidth < 730)
22
+ return;
23
+ o.togglePanel(!0), o.togglePanelPosition("bottom"), o.setSelectedPanel(r);
24
+ let e = document.createElement("div");
25
+ e.id = "storybook-addon-onboarding", document.body.appendChild(e), s.render(
26
+ n.createElement(i, { fallback: n.createElement("div", null) }, n.createElement(b, { api: o })),
27
+ e
28
+ );
29
+ });
30
+ });
package/dist/preset.js CHANGED
@@ -1,8 +1,41 @@
1
- 'use strict';
1
+ import CJS_COMPAT_NODE_URL from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE from "node:module";
2
4
 
3
- var fs = require('fs');
4
- var telemetry = require('storybook/internal/telemetry');
5
+ const __filename = CJS_COMPAT_NODE_URL.fileURLToPath(import.meta.url);
6
+ const __dirname = CJS_COMPAT_NODE_PATH.dirname(__filename);
7
+ const require = CJS_COMPAT_NODE_MODULE.createRequire(import.meta.url);
8
+ // ------------------------------------------------------------
9
+ // end of CJS compatibility banner, injected by Storybook's esbuild configuration
10
+ // ------------------------------------------------------------
11
+ var N = Object.defineProperty;
12
+ var a = (o, e) => N(o, "name", { value: e, configurable: !0 }), O = /* @__PURE__ */ ((o) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(o, {
13
+ get: (e, r) => (typeof require < "u" ? require : e)[r]
14
+ }) : o)(function(o) {
15
+ if (typeof require < "u") return require.apply(this, arguments);
16
+ throw Error('Dynamic require of "' + o + '" is not supported');
17
+ });
5
18
 
6
- var __require=(x=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(x,{get:(a,b)=>(typeof require<"u"?require:a)[b]}):x)(function(x){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+x+'" is not supported')});var STORYBOOK_ADDON_ONBOARDING_CHANNEL="STORYBOOK_ADDON_ONBOARDING_CHANNEL";var experimental_serverChannel=async(channel,options)=>{let{disableTelemetry}=await options.presets.apply("core",{});if(!disableTelemetry){let packageJsonPath=__require.resolve("@storybook/addon-onboarding/package.json"),{version:addonVersion}=JSON.parse(fs.readFileSync(packageJsonPath,{encoding:"utf-8"}));channel.on(STORYBOOK_ADDON_ONBOARDING_CHANNEL,({type,...event})=>{type==="telemetry"&&telemetry.telemetry("addon-onboarding",{...event,addonVersion});});}return channel};
19
+ // src/preset.ts
20
+ import { readFileSync as l } from "node:fs";
21
+ import { telemetry as p } from "storybook/internal/telemetry";
7
22
 
8
- exports.experimental_serverChannel = experimental_serverChannel;
23
+ // src/constants.ts
24
+ var i = "STORYBOOK_ADDON_ONBOARDING_CHANNEL";
25
+
26
+ // src/preset.ts
27
+ var _ = /* @__PURE__ */ a(async (o, e) => {
28
+ let { disableTelemetry: r } = await e.presets.apply("core", {});
29
+ if (!r) {
30
+ let y = O.resolve("@storybook/addon-onboarding/package.json"), { version: n } = JSON.parse(
31
+ l(y, { encoding: "utf-8" })
32
+ );
33
+ o.on(i, ({ type: t, ...s }) => {
34
+ t === "telemetry" ? p("addon-onboarding", { ...s, addonVersion: n }) : t === "survey" && p("onboarding-survey", { ...s, addonVersion: n });
35
+ });
36
+ }
37
+ return o;
38
+ }, "experimental_serverChannel");
39
+ export {
40
+ _ as experimental_serverChannel
41
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook/addon-onboarding",
3
- "version": "0.0.0-pr-30601-sha-d70f67e1",
3
+ "version": "0.0.0-pr-31819-sha-b1c88d51",
4
4
  "description": "Storybook Addon Onboarding - Introduces a new onboarding experience",
5
5
  "keywords": [
6
6
  "storybook-addons",
@@ -20,19 +20,16 @@
20
20
  "url": "https://opencollective.com/storybook"
21
21
  },
22
22
  "license": "MIT",
23
+ "type": "module",
23
24
  "exports": {
24
25
  ".": {
25
26
  "types": "./dist/index.d.ts",
26
- "import": "./dist/index.mjs",
27
- "require": "./dist/index.js"
27
+ "default": "./dist/index.js"
28
28
  },
29
29
  "./manager": "./dist/manager.js",
30
- "./preset": "./dist/preset.js",
31
- "./package.json": "./package.json"
30
+ "./package.json": "./package.json",
31
+ "./preset": "./dist/preset.js"
32
32
  },
33
- "main": "dist/index.js",
34
- "module": "dist/index.mjs",
35
- "types": "dist/index.d.ts",
36
33
  "files": [
37
34
  "dist/**/*",
38
35
  "README.md",
@@ -41,8 +38,8 @@
41
38
  "!src/**/*"
42
39
  ],
43
40
  "scripts": {
44
- "check": "jiti ../../../scripts/prepare/check.ts",
45
- "prep": "jiti ../../../scripts/prepare/addon-bundle.ts"
41
+ "check": "jiti ../../../scripts/check/check-package.ts",
42
+ "prep": "jiti ../../../scripts/build/build-package.ts"
46
43
  },
47
44
  "devDependencies": {
48
45
  "@neoconfetti/react": "^1.0.0",
@@ -53,20 +50,9 @@
53
50
  "typescript": "^5.8.3"
54
51
  },
55
52
  "peerDependencies": {
56
- "storybook": "^0.0.0-pr-30601-sha-d70f67e1"
53
+ "storybook": "^0.0.0-pr-31819-sha-b1c88d51"
57
54
  },
58
55
  "publishConfig": {
59
56
  "access": "public"
60
- },
61
- "bundler": {
62
- "exportEntries": [
63
- "./src/index.ts"
64
- ],
65
- "managerEntries": [
66
- "./src/manager.tsx"
67
- ],
68
- "nodeEntries": [
69
- "./src/preset.ts"
70
- ]
71
57
  }
72
58
  }