@multiplatform.one/storybook 6.1.0 → 6.3.0

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 (43) hide show
  1. package/README.md +30 -104
  2. package/dist/cjs/CreatePreview.cjs +7 -2
  3. package/dist/cjs/CreatePreview.native.js +11 -2
  4. package/dist/cjs/CreatePreview.native.js.map +1 -1
  5. package/dist/cjs/index.cjs +2 -0
  6. package/dist/cjs/safeAction.cjs +74 -0
  7. package/dist/cjs/safeAction.native.js +119 -0
  8. package/dist/cjs/safeAction.native.js.map +1 -0
  9. package/dist/esm/CreatePreview.mjs +8 -3
  10. package/dist/esm/CreatePreview.mjs.map +1 -1
  11. package/dist/esm/CreatePreview.native.js +12 -3
  12. package/dist/esm/CreatePreview.native.js.map +1 -1
  13. package/dist/esm/index.mjs +2 -1
  14. package/dist/esm/index.mjs.map +1 -1
  15. package/dist/esm/safeAction.mjs +49 -0
  16. package/dist/esm/safeAction.mjs.map +1 -0
  17. package/dist/esm/safeAction.native.js +91 -0
  18. package/dist/esm/safeAction.native.js.map +1 -0
  19. package/dist/jsx/CreatePreview.mjs +8 -3
  20. package/dist/jsx/CreatePreview.mjs.map +1 -1
  21. package/dist/jsx/CreatePreview.native.js +11 -2
  22. package/dist/jsx/CreatePreview.native.js.map +1 -1
  23. package/dist/jsx/index.js +2 -1
  24. package/dist/jsx/index.js.map +1 -1
  25. package/dist/jsx/index.mjs +2 -1
  26. package/dist/jsx/index.mjs.map +1 -1
  27. package/dist/jsx/safeAction.mjs +49 -0
  28. package/dist/jsx/safeAction.mjs.map +1 -0
  29. package/dist/jsx/safeAction.native.js +119 -0
  30. package/dist/jsx/safeAction.native.js.map +1 -0
  31. package/package.json +9 -6
  32. package/src/CreatePreview.tsx +15 -2
  33. package/src/index.ts +4 -1
  34. package/src/safeAction.spec.ts +83 -0
  35. package/src/safeAction.ts +76 -0
  36. package/types/CreatePreview.d.ts +53 -0
  37. package/types/CreatePreview.d.ts.map +1 -0
  38. package/types/index.d.ts +5 -0
  39. package/types/index.d.ts.map +1 -0
  40. package/types/index.native.d.ts +7 -0
  41. package/types/index.native.d.ts.map +1 -0
  42. package/types/safeAction.d.ts +18 -0
  43. package/types/safeAction.d.ts.map +1 -0
@@ -0,0 +1,5 @@
1
+ export * from "@storybook/addon-actions";
2
+ export { action } from "./safeAction";
3
+ export { createPreview, themeColorsChannelEvent, themeColorsOppositeChannelEvent, } from "./CreatePreview";
4
+ export type { CreatePreviewOptions, CreatePreviewI18n, Preview } from "./CreatePreview";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AAGzC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EACL,aAAa,EACb,uBAAuB,EACvB,+BAA+B,GAChC,MAAM,iBAAiB,CAAC;AACzB,YAAY,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * `@storybook/addon-ondevice-actions` registers the panel but does not export `action`.
3
+ * `storybook/actions` is browser-bundled and breaks under Metro. Mirror the `action(name)`
4
+ * helper so shared `.stories.tsx` work on Expo Storybook.
5
+ */
6
+ export declare function action(name: string): (...args: unknown[]) => void;
7
+ //# sourceMappingURL=index.native.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../src/index.native.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,IACzB,GAAG,MAAM,OAAO,EAAE,UAK3B"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Cycle-safe `action` wrapper.
3
+ *
4
+ * Stories commonly wire handlers straight through (`onPress={action("onPress")}`),
5
+ * which hands the raw press event / live-query docs to the actions channel.
6
+ * Storybook's PostMessageTransport JSON.stringifies the payload, and React
7
+ * synthetic events / elements are cyclic (element → props → children → …
8
+ * fiber → stateNode closes the circle), so the send throws
9
+ * `TypeError: Converting circular structure to JSON` as an uncaught pageerror
10
+ * (seen in the DebugLayout and FrappeListView stories).
11
+ *
12
+ * This wrapper sanitizes args before they reach the channel: cycles become
13
+ * "[Circular]", React elements/fibers/DOM nodes become short summaries, and
14
+ * depth is capped so the Actions panel stays readable.
15
+ */
16
+ import { action as addonAction } from "@storybook/addon-actions";
17
+ export declare function action(name: string, options?: Parameters<typeof addonAction>[1]): ReturnType<typeof addonAction>;
18
+ //# sourceMappingURL=safeAction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"safeAction.d.ts","sourceRoot":"","sources":["../src/safeAction.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAqDjE,wBAAgB,MAAM,CACpB,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,CAAC,GAC1C,UAAU,CAAC,OAAO,WAAW,CAAC,CAIhC"}