@plasmicapp/react-web 0.2.250 → 0.2.252

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 (56) hide show
  1. package/LICENSE.app.md +661 -0
  2. package/dist/all.d.ts +73 -47
  3. package/dist/auth/PlasmicPageGuard.d.ts +1 -1
  4. package/dist/index.cjs.js +7 -2
  5. package/dist/index.cjs.js.map +1 -1
  6. package/dist/plume/collection-utils.d.ts +3 -3
  7. package/dist/plume/menu-button/DropdownMenu.d.ts +1 -1
  8. package/dist/react-utils.d.ts +1 -1
  9. package/dist/react-web.esm.js +7 -2
  10. package/dist/react-web.esm.js.map +1 -1
  11. package/dist/render/PlasmicHead/index.d.ts +1 -1
  12. package/dist/render/PlasmicIcon.d.ts +1 -1
  13. package/dist/render/PlasmicLink.d.ts +2 -2
  14. package/dist/render/PlasmicSlot.d.ts +2 -2
  15. package/dist/render/ssr.d.ts +1 -1
  16. package/dist/states/valtio.d.ts +1 -1
  17. package/dist/stories/PlasmicImg.stories.d.ts +2 -3
  18. package/dist/stories/UseDollarState.stories.d.ts +22 -23
  19. package/lib/auth/PlasmicPageGuard.d.ts +1 -1
  20. package/package.json +19 -12
  21. package/skinny/dist/auth/PlasmicPageGuard.d.ts +1 -1
  22. package/skinny/dist/{collection-utils-12be6625.js → collection-utils-b8088b18.js} +4 -4
  23. package/skinny/dist/{collection-utils-12be6625.js.map → collection-utils-b8088b18.js.map} +1 -1
  24. package/skinny/dist/{common-e74df507.js → common-7e2bbe30.js} +8 -3
  25. package/skinny/dist/common-7e2bbe30.js.map +1 -0
  26. package/skinny/dist/index.js +4 -4
  27. package/skinny/dist/plume/button/index.js +2 -2
  28. package/skinny/dist/plume/checkbox/index.js +5 -5
  29. package/skinny/dist/plume/collection-utils.d.ts +3 -3
  30. package/skinny/dist/plume/menu/index.js +6 -6
  31. package/skinny/dist/plume/menu-button/DropdownMenu.d.ts +1 -1
  32. package/skinny/dist/plume/menu-button/index.js +5 -5
  33. package/skinny/dist/plume/select/index.js +6 -6
  34. package/skinny/dist/plume/switch/index.js +5 -5
  35. package/skinny/dist/plume/text-input/index.js +2 -2
  36. package/skinny/dist/plume/triggered-overlay/index.js +4 -4
  37. package/skinny/dist/{plume-utils-3d2c0c98.js → plume-utils-9472dfe6.js} +2 -2
  38. package/skinny/dist/{plume-utils-3d2c0c98.js.map → plume-utils-9472dfe6.js.map} +1 -1
  39. package/skinny/dist/{props-utils-30c7073a.js → props-utils-b08721e5.js} +2 -2
  40. package/skinny/dist/{props-utils-30c7073a.js.map → props-utils-b08721e5.js.map} +1 -1
  41. package/skinny/dist/{react-utils-8796beba.js → react-utils-d266354d.js} +2 -2
  42. package/skinny/dist/{react-utils-8796beba.js.map → react-utils-d266354d.js.map} +1 -1
  43. package/skinny/dist/react-utils.d.ts +1 -1
  44. package/skinny/dist/render/PlasmicHead/index.d.ts +1 -1
  45. package/skinny/dist/render/PlasmicIcon.d.ts +1 -1
  46. package/skinny/dist/render/PlasmicImg/index.js +2 -2
  47. package/skinny/dist/render/PlasmicLink.d.ts +2 -2
  48. package/skinny/dist/render/PlasmicSlot.d.ts +2 -2
  49. package/skinny/dist/render/ssr.d.ts +1 -1
  50. package/skinny/dist/{ssr-90db5fad.js → ssr-145c6cd2.js} +2 -2
  51. package/skinny/dist/{ssr-90db5fad.js.map → ssr-145c6cd2.js.map} +1 -1
  52. package/skinny/dist/states/valtio.d.ts +1 -1
  53. package/skinny/dist/stories/PlasmicImg.stories.d.ts +2 -3
  54. package/skinny/dist/stories/UseDollarState.stories.d.ts +22 -23
  55. package/LICENSE.md +0 -21
  56. package/skinny/dist/common-e74df507.js.map +0 -1
@@ -6,7 +6,7 @@ type PlasmicHeadProps = {
6
6
  image?: string;
7
7
  canonical?: string;
8
8
  };
9
- export declare function PlasmicHead(props: PlasmicHeadProps): JSX.Element | null;
9
+ export declare function PlasmicHead(props: PlasmicHeadProps): React.JSX.Element | null;
10
10
  export declare const plasmicHeadMeta: {
11
11
  name: string;
12
12
  displayName: string;
@@ -1,4 +1,4 @@
1
1
  import * as React from "react";
2
2
  export declare function PlasmicIcon(props: React.ComponentProps<"svg"> & {
3
3
  PlasmicIconType: React.ComponentType;
4
- }): JSX.Element;
4
+ }): React.JSX.Element;
@@ -1,3 +1,3 @@
1
1
  import React from "react";
2
- export declare const PlasmicLink: React.ForwardRefExoticComponent<Pick<any, string | number | symbol> & React.RefAttributes<any>>;
3
- export declare const PlasmicLinkInternal: React.ForwardRefExoticComponent<Pick<any, string | number | symbol> & React.RefAttributes<any>>;
2
+ export declare const PlasmicLink: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<any>>;
3
+ export declare const PlasmicLinkInternal: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<any>>;
@@ -3,9 +3,9 @@ export declare function PlasmicSlot<T extends keyof JSX.IntrinsicElements = "div
3
3
  as?: T;
4
4
  defaultContents?: React.ReactNode;
5
5
  value?: React.ReactNode;
6
- }): JSX.Element | null;
6
+ }): React.JSX.Element | null;
7
7
  export declare function renderPlasmicSlot<T extends keyof JSX.IntrinsicElements = "div">(opts: {
8
8
  as?: T;
9
9
  defaultContents?: React.ReactNode;
10
10
  value?: React.ReactNode;
11
- }): JSX.Element | null;
11
+ }): React.JSX.Element | null;
@@ -19,7 +19,7 @@ export interface PlasmicRootProviderProps extends PlasmicDataSourceContextValue
19
19
  disableLoadingBoundary?: boolean;
20
20
  suspenseFallback?: React.ReactNode;
21
21
  }
22
- export declare function PlasmicRootProvider(props: PlasmicRootProviderProps): JSX.Element;
22
+ export declare function PlasmicRootProvider(props: PlasmicRootProviderProps): React.JSX.Element;
23
23
  export declare const useIsSSR: typeof useAriaIsSSR;
24
24
  export declare function useHasPlasmicRoot(): boolean;
25
25
  /**
@@ -1,7 +1,7 @@
1
1
  import { StateSpecNode } from "./graph";
2
2
  import { $State, $StateSpec, Internal$State, ObjectPath, StateCell } from "./types";
3
3
  export declare const proxyObjToStateCell: WeakMap<object, Record<string | number | symbol, StateCell<any>>>;
4
- export declare const valtioSubscriptions: WeakMap<object, (() => boolean)[]>;
4
+ export declare const valtioSubscriptions: WeakMap<object, (() => void)[]>;
5
5
  export declare function tryGetStateCellFrom$StateRoot($state: $State, path: ObjectPath): StateCell<any> | undefined;
6
6
  export declare function getStateCellFrom$StateRoot($state: $State, path: ObjectPath): StateCell<any>;
7
7
  export declare function unsubscribeToValtio($$state: Internal$State, statePath: ObjectPath): void;
@@ -1,6 +1,5 @@
1
- import { ComponentMeta, ComponentStory } from "@storybook/react";
2
1
  import React from "react";
3
2
  import "../styles/plasmic.css";
4
- export declare const Base: ComponentStory<React.ForwardRefExoticComponent<import("../render/PlasmicImg").PlasmicImgProps & React.RefAttributes<HTMLElement>>>;
5
- declare const _default: ComponentMeta<React.ForwardRefExoticComponent<import("../render/PlasmicImg").PlasmicImgProps & React.RefAttributes<HTMLElement>>>;
3
+ export declare const Base: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, import("../render/PlasmicImg").PlasmicImgProps & React.RefAttributes<HTMLElement>>;
4
+ declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0a347bb9").R, import("../render/PlasmicImg").PlasmicImgProps & React.RefAttributes<HTMLElement>>;
6
5
  export default _default;
@@ -1,4 +1,3 @@
1
- import { Story } from "@storybook/react";
2
1
  import React from "react";
3
2
  declare const _default: {
4
3
  title: string;
@@ -13,66 +12,66 @@ interface CounterArgs {
13
12
  "data-testid"?: string;
14
13
  title?: React.ReactNode;
15
14
  }
16
- export declare const PrivateCounter: Story<CounterArgs>;
17
- export declare const ReadonlyCounter: Story<{
15
+ export declare const PrivateCounter: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, CounterArgs>;
16
+ export declare const ReadonlyCounter: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, {
18
17
  counterStateType?: "readonly" | "writable" | undefined;
19
18
  }>;
20
- export declare const WritableCounter: Story<{
19
+ export declare const WritableCounter: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, {
21
20
  counterStateType?: "readonly" | "writable" | undefined;
22
21
  }>;
23
- export declare const DynamicInitCount: Story;
24
- export declare const ResetInput: Story<{
22
+ export declare const DynamicInitCount: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, import("@storybook/types").Args>;
23
+ export declare const ResetInput: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, {
25
24
  peopleList: {
26
25
  firstName: string;
27
26
  lastName: string;
28
27
  }[];
29
28
  }>;
30
- export declare const RepeatedStates: Story<{
29
+ export declare const RepeatedStates: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, {
31
30
  size: number;
32
31
  }>;
33
- export declare const NestedRepeatedCounter: Story<{}>;
34
- export declare const MatrixRepeatedCounter: Story<{}>;
35
- export declare const InitFuncFromInternalContextData: Story<{
32
+ export declare const NestedRepeatedCounter: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, {}>;
33
+ export declare const MatrixRepeatedCounter: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, {}>;
34
+ export declare const InitFuncFromInternalContextData: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, {
36
35
  products: {
37
36
  price: number;
38
37
  name: string;
39
38
  }[];
40
39
  }>;
41
- export declare const InitFuncFromRootContextData: Story<{
40
+ export declare const InitFuncFromRootContextData: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, {
42
41
  products: {
43
42
  price: number;
44
43
  name: string;
45
44
  }[];
46
45
  }>;
47
- export declare const InitFuncFromInternalContextDataWithDelay: Story<{
46
+ export declare const InitFuncFromInternalContextDataWithDelay: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, {
48
47
  products: {
49
48
  price: number;
50
49
  name: string;
51
50
  }[];
52
51
  }>;
53
- export declare const RepeatedImplicitState: Story<{}>;
52
+ export declare const RepeatedImplicitState: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, {}>;
54
53
  interface Person {
55
54
  firstName: string;
56
55
  lastName: string;
57
56
  nicknames: string[];
58
57
  }
59
- export declare const FormBuilder: Story<{
58
+ export declare const FormBuilder: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, {
60
59
  people: Person[];
61
60
  }>;
62
- export declare const FormBuilderImplicitStates: Story<{
61
+ export declare const FormBuilderImplicitStates: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, {
63
62
  people: Person[];
64
63
  }>;
65
- export declare const StateCellIsArray: Story<{
64
+ export declare const StateCellIsArray: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, {
66
65
  people: Person[];
67
66
  }>;
68
- export declare const StateCellIsMatrix: Story<{
67
+ export declare const StateCellIsMatrix: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, {
69
68
  board: number[][];
70
69
  }>;
71
- export declare const IsOnChangePropImmediatelyFired: Story<{}>;
72
- export declare const ImmutableStateCells: Story<{
70
+ export declare const IsOnChangePropImmediatelyFired: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, {}>;
71
+ export declare const ImmutableStateCells: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, {
73
72
  people: Person[];
74
73
  }>;
75
- export declare const InCanvasDollarState: Story<{}>;
76
- export declare const AddDeleteSpecsInCanvas: Story<{}>;
77
- export declare const TodoApp: Story<{}>;
78
- export declare const CycleInStateInitialization: Story<{}>;
74
+ export declare const InCanvasDollarState: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, {}>;
75
+ export declare const AddDeleteSpecsInCanvas: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, {}>;
76
+ export declare const TodoApp: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, {}>;
77
+ export declare const CycleInStateInitialization: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, {}>;
@@ -7,6 +7,6 @@ interface PlasmicPageGuardProps {
7
7
  children: React.ReactNode;
8
8
  unauthorizedComp?: React.ReactNode;
9
9
  }
10
- export declare function PlasmicPageGuard(props: PlasmicPageGuardProps): JSX.Element | null;
10
+ export declare function PlasmicPageGuard(props: PlasmicPageGuardProps): React.JSX.Element | null;
11
11
  export declare function withPlasmicPageGuard<P extends object>(WrappedComponent: React.ComponentType<P>, options: Omit<PlasmicPageGuardProps, "children">): React.FC<P>;
12
12
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plasmicapp/react-web",
3
- "version": "0.2.250",
3
+ "version": "0.2.252",
4
4
  "description": "plasmic library for rendering in the presentational style",
5
5
  "main": "dist/index.cjs.js",
6
6
  "types": "dist/index.d.ts",
@@ -77,8 +77,8 @@
77
77
  "prepare": "if-env PREPARE_NO_BUILD=true || yarn build",
78
78
  "size": "size-limit",
79
79
  "analyze": "size-limit --why",
80
- "storybook": "start-storybook -p 6006",
81
- "build-storybook": "build-storybook",
80
+ "storybook": "storybook dev -p 6006",
81
+ "build-storybook": "storybook build",
82
82
  "test-storybook": "test-storybook"
83
83
  },
84
84
  "husky": {
@@ -89,9 +89,9 @@
89
89
  "prettier": {},
90
90
  "dependencies": {
91
91
  "@plasmicapp/auth-react": "0.0.7",
92
- "@plasmicapp/data-sources": "0.1.108",
92
+ "@plasmicapp/data-sources": "0.1.109",
93
93
  "@plasmicapp/data-sources-context": "0.1.11",
94
- "@plasmicapp/host": "1.0.162",
94
+ "@plasmicapp/host": "1.0.163",
95
95
  "@plasmicapp/prepass": "1.0.3",
96
96
  "@plasmicapp/query": "0.1.68",
97
97
  "@react-aria/checkbox": "^3.5.0",
@@ -120,6 +120,9 @@
120
120
  },
121
121
  "devDependencies": {
122
122
  "@babel/core": "^7.14.6",
123
+ "@babel/preset-env": "^7.22.15",
124
+ "@babel/preset-react": "^7.22.15",
125
+ "@babel/preset-typescript": "^7.22.15",
123
126
  "@react-types/overlays": "^3.5.5",
124
127
  "@react-types/select": "^3.5.5",
125
128
  "@react-types/shared": "^3.12.0",
@@ -127,13 +130,16 @@
127
130
  "@rollup/plugin-json": "^6.0.0",
128
131
  "@rollup/plugin-node-resolve": "^15.1.0",
129
132
  "@size-limit/preset-small-lib": "^4.10.2",
130
- "@storybook/addon-actions": "^6.3.4",
131
- "@storybook/addon-essentials": "^6.3.4",
132
- "@storybook/addon-interactions": "^6.5.9",
133
- "@storybook/addon-links": "^6.3.4",
133
+ "@storybook/addon-actions": "^7.4.0",
134
+ "@storybook/addon-essentials": "^7.4.0",
135
+ "@storybook/addon-info": "^5.3.21",
136
+ "@storybook/addon-interactions": "^7.4.0",
137
+ "@storybook/addon-links": "^7.4.0",
138
+ "@storybook/addons": "^7.4.0",
134
139
  "@storybook/jest": "^0.0.10",
135
- "@storybook/react": "^6.5.9",
136
- "@storybook/test-runner": "^0.5.0",
140
+ "@storybook/react": "^7.4.0",
141
+ "@storybook/react-webpack5": "^7.4.0",
142
+ "@storybook/test-runner": "^0.13.0",
137
143
  "@storybook/testing-library": "^0.0.13",
138
144
  "@types/classnames": "^2.2.9",
139
145
  "@types/clone": "^2.1.1",
@@ -151,6 +157,7 @@
151
157
  "rollup-plugin-dts": "^5.3.0",
152
158
  "rollup-plugin-typescript2": "^0.35.0",
153
159
  "size-limit": "^4.10.2",
160
+ "storybook": "^7.4.0",
154
161
  "tsdx": "^0.14.1",
155
162
  "tslib": "^2.3.1"
156
163
  },
@@ -158,5 +165,5 @@
158
165
  "react": ">=16.8.0",
159
166
  "react-dom": ">=16.8.0"
160
167
  },
161
- "gitHead": "bf12f2268d3e2794698bee0996d4e2008b6827c5"
168
+ "gitHead": "ab608db4274a0622f29909c4c735aa79313b779d"
162
169
  }
@@ -7,6 +7,6 @@ interface PlasmicPageGuardProps {
7
7
  children: React.ReactNode;
8
8
  unauthorizedComp?: React.ReactNode;
9
9
  }
10
- export declare function PlasmicPageGuard(props: PlasmicPageGuardProps): JSX.Element | null;
10
+ export declare function PlasmicPageGuard(props: PlasmicPageGuardProps): React.JSX.Element | null;
11
11
  export declare function withPlasmicPageGuard<P extends object>(WrappedComponent: React.ComponentType<P>, options: Omit<PlasmicPageGuardProps, "children">): React.FC<P>;
12
12
  export {};
@@ -1,8 +1,8 @@
1
- import { a as __assign, k as isString } from './common-e74df507.js';
1
+ import { a as __assign, k as isString } from './common-7e2bbe30.js';
2
2
  import { Item, Section } from '@react-stately/collections';
3
3
  import React__default from 'react';
4
- import { t as toChildArray, g as getElementTypeName } from './react-utils-8796beba.js';
5
- import { g as getPlumeType, P as PLUME_STRICT_MODE } from './plume-utils-3d2c0c98.js';
4
+ import { t as toChildArray, g as getElementTypeName } from './react-utils-d266354d.js';
5
+ import { g as getPlumeType, P as PLUME_STRICT_MODE } from './plume-utils-9472dfe6.js';
6
6
 
7
7
  /**
8
8
  * In general, we try not to expose react-aria's Collections API to Plume users.
@@ -300,4 +300,4 @@ function cloneChild(child, props) {
300
300
  }
301
301
 
302
302
  export { renderAsCollectionChild as a, useDerivedItems as b, getChildProp as g, renderCollectionNode as r, useDerivedItemsFromChildren as u };
303
- //# sourceMappingURL=collection-utils-12be6625.js.map
303
+ //# sourceMappingURL=collection-utils-b8088b18.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"collection-utils-12be6625.js","sources":["../../src/plume/collection-utils.tsx"],"sourcesContent":["/**\n * In general, we try not to expose react-aria's Collections API to Plume users.\n * The Collections API is how react-aria users pass data about collections of\n * things using the built-in Item and Section components, which are abstract,\n * metadata-only components that don't render anything but only serve to specify\n * data. For example, here's how you would use react-spectrum's Picker:\n *\n * <Picker>\n * <Section title=\"Asia\">\n * <Item key=\"taiwan\">Taiwan</Item>\n * <Item key=\"japan\">Japan</Item>\n * <Item key=\"china\">China</Item>\n * </Section>\n * <Section title=\"Europe\">\n * <Item key=\"germany\">Germany</Item>\n * <Item key=\"france\">France</Item>\n * </Section>\n * </Picker>\n *\n * You would re-use this same Item/Section components to pass similar things to\n * Menu, Tabs, etc.\n *\n * For Plasmic, this API is too abstract. The user has explicitly designed components\n * like Select.Option and Select.OptionGroup, and it is weird that they don't actually\n * use these components. It is more natural to do:\n *\n * <Select>\n * <Select.OptionGroup title=\"Asia\">\n * <Select.Option key=\"taiwan\">Taiwan</Select>\n * </Select.OptionGroup>\n * </Select>\n *\n * For Plume, we let users directly use the components they designed, both to collect\n * information and to perform actual rendering. For example, for Plume,\n * you'd use Select.Option instead of Item, and Select.OptionGroup instead of Section.\n * This means that the Select.Option props will collect the same information Item\n * does.\n *\n * A component like Select.Option then serves two purposes:\n *\n * 1. Allow users to specify the collection of data, like in the above example\n * Here, we're mainly interested in the props in those ReactElements so\n * we can pass the Item/Section data onto react-aria's APIs. We are not\n * actually rendering these elements.\n * 2. Once react-aria's Collections API has gone through them and built\n * Collection \"nodes\", we then create cloned versions of these elements\n * with the corresponding node passed in as a secret prop. These ReactElements\n * are then actually used to _render_ the corresponding Option / OptionGroup.\n *\n * This file contains helper functions to help with implementing the above.\n *\n * Note also that most of the collections-based react-aria components expose\n * a parallel API that accepts a list of \"items\" and a render prop, instead\n * of list of Item/Section elements. This is for efficiency, but we are opting\n * to only support the composite-component pattern for now for simplicity.\n */\n\nimport { Item, Section } from \"@react-stately/collections\";\nimport { Node } from \"@react-types/shared\";\nimport React from \"react\";\nimport { isString } from \"../common\";\nimport { getElementTypeName, toChildArray } from \"../react-utils\";\nimport { getPlumeType, PLUME_STRICT_MODE } from \"./plume-utils\";\n\nexport interface PlasmicLoaderProps<T> {\n component: string;\n componentProps: T;\n}\n\n/**\n * Props for a Plume component that corresponds to an Item\n */\nexport interface ItemLikeProps {\n /**\n * value key corresponding to this item. Not required if you use the\n * `key` prop instead.\n */\n value?: string | null;\n\n /**\n * The text string value corresponding to this item. Used to support\n * keyboard type-ahead. If not specified, then will be derived from\n * `children` if it is a string, or the `value` or `key`.\n */\n textValue?: string;\n\n /**\n * aria-label for this item.\n */\n \"aria-label\"?: string;\n\n /**\n * Primary content label for this item.\n */\n children?: React.ReactNode;\n\n /**\n * If true, this item will not be selectable.\n */\n isDisabled?: boolean;\n}\n\ntype LoaderAwareItemLikeProps =\n | ItemLikeProps\n | PlasmicLoaderProps<ItemLikeProps>;\n\n/**\n * Props for a Plume component that corresponds to a Section\n */\nexport interface SectionLikeProps {\n /**\n * Heading content of the title\n */\n title?: React.ReactNode;\n\n /**\n * aria-label for this section\n */\n \"aria-label\"?: string;\n\n /**\n * A list of items that belong in this group\n */\n children?: React.ReactNode;\n}\n\ntype LoaderAwareSectionLikeProps =\n | SectionLikeProps\n | PlasmicLoaderProps<SectionLikeProps>;\n\nexport type ItemJson = LeafItemJson | SectionJson;\n\nexport type LeafItemJson =\n | string\n | {\n value: string;\n label?: string;\n textValue?: string;\n isDisabled?: boolean;\n };\n\nexport interface SectionJson {\n title: string;\n children: ItemJson[];\n}\n\nexport function deriveItemsFromProps(\n props: any,\n opts: {\n itemPlumeType: string;\n sectionPlumeType?: string;\n invalidChildError?: string;\n requireItemValue: boolean;\n ItemComponent?: React.ComponentType<ItemLikeProps>;\n SectionComponent?: React.ComponentType<SectionLikeProps>;\n itemsProp?: string;\n }\n) {\n if (opts.itemsProp && opts.itemsProp in props) {\n if (!opts.ItemComponent || !opts.SectionComponent) {\n throw new Error(`You may need to re-generate your Plasmic* files`);\n }\n const items = props[opts.itemsProp] as ItemJson[] | undefined;\n return deriveItemsFromItemsProp(items, {\n ItemComponent: opts.ItemComponent,\n SectionComponent: opts.SectionComponent,\n });\n } else {\n return deriveItemsFromChildren(props.children as React.ReactNode, opts);\n }\n}\n\nfunction deriveItemsFromItemsProp(\n items: ItemJson[] | undefined,\n opts: {\n ItemComponent: React.ComponentType<ItemLikeProps>;\n SectionComponent: React.ComponentType<SectionLikeProps>;\n }\n) {\n const { ItemComponent, SectionComponent } = opts;\n const disabledKeys: string[] = [];\n const transform = (item: ItemJson) => {\n if (typeof item === \"string\") {\n return (\n <ItemComponent key={item} value={item}>\n {item}\n </ItemComponent>\n );\n } else if (\"children\" in item) {\n return (\n <SectionComponent key={item.title} title={item.title}>\n {item.children.map((x) => transform(x))}\n </SectionComponent>\n );\n } else {\n if (item.isDisabled) {\n disabledKeys.push(item.value);\n }\n return (\n <ItemComponent\n key={item.value}\n value={item.value}\n textValue={item.textValue}\n isDisabled={item.isDisabled}\n >\n {item.label ?? item.value}\n </ItemComponent>\n );\n }\n };\n return {\n items: items?.map((x) => transform(x)) ?? [],\n disabledKeys,\n };\n}\n\n/**\n * Given children of a component like Select or Menu, derive the items\n * that we will pass into the Collections API. These will be\n * ReactElement<ItemLikeProps|SectionLikeProps>[].\n *\n * Will also assign keys to items by their index in the collection,\n * and collect the keys of disabled items.\n */\nexport function deriveItemsFromChildren<T extends React.ReactElement>(\n children: React.ReactNode,\n opts: {\n itemPlumeType: string;\n sectionPlumeType?: string;\n invalidChildError?: string;\n requireItemValue: boolean;\n }\n) {\n if (!children) {\n return {\n items: [] as T[],\n disabledKeys: [] as React.Key[],\n };\n }\n\n const { itemPlumeType, sectionPlumeType, invalidChildError } = opts;\n\n // For Plume items without an explicit key, we assign a key as the index\n // of the collection.\n let itemCount = 0;\n let sectionCount = 0;\n\n const ensureValue = (element: React.ReactElement) => {\n if (!propInChild(element, \"value\")) {\n if (opts.requireItemValue && PLUME_STRICT_MODE) {\n throw new Error(\n `Must specify a \"value\" prop for ${getElementTypeName(element)}`\n );\n } else {\n return cloneChild(element, { value: `${itemCount++}` });\n }\n } else {\n // Still increment count even if key is present, so that the\n // auto-assigned key really reflects the index\n itemCount++;\n return element;\n }\n };\n\n const disabledKeys: React.Key[] = [];\n\n const flattenedChildren = (\n children: React.ReactNode\n ): React.ReactElement[] => {\n return toChildArray(children).flatMap((child) => {\n if (React.isValidElement(child)) {\n if (child.type === React.Fragment) {\n return flattenedChildren(\n (child as React.ReactElement<{ children: React.ReactNode }>).props\n .children\n );\n }\n const type = getPlumeType(child);\n if (type === itemPlumeType) {\n child = ensureValue(child);\n const childKey = getItemLikeKey(child);\n if (getChildProp(child, \"isDisabled\") && !!childKey) {\n disabledKeys.push(childKey);\n }\n return [child];\n }\n if (type === sectionPlumeType) {\n return [\n cloneChild(child, {\n // key of section doesn't actually matter, just needs\n // to be unique\n key: child.key ?? `section-${sectionCount++}`,\n children: flattenedChildren(getChildProp(child, \"children\")),\n }),\n ];\n }\n }\n\n if (PLUME_STRICT_MODE) {\n throw new Error(invalidChildError ?? `Unexpected child`);\n } else {\n return [];\n }\n });\n };\n\n return { items: flattenedChildren(children) as T[], disabledKeys };\n}\n\nexport function useDerivedItems(\n props: any,\n opts: {\n itemPlumeType: string;\n sectionPlumeType?: string;\n invalidChildError?: string;\n requireItemValue: boolean;\n ItemComponent?: React.ComponentType<ItemLikeProps>;\n SectionComponent?: React.ComponentType<SectionLikeProps>;\n itemsProp?: string;\n }\n) {\n const { children } = props;\n const {\n itemPlumeType,\n sectionPlumeType,\n invalidChildError,\n requireItemValue,\n ItemComponent,\n SectionComponent,\n itemsProp,\n } = opts;\n const items = itemsProp ? props[itemsProp] : undefined;\n return React.useMemo(() => {\n return deriveItemsFromProps(props, {\n itemPlumeType,\n sectionPlumeType,\n invalidChildError,\n requireItemValue,\n itemsProp,\n ItemComponent,\n SectionComponent,\n });\n }, [\n children,\n items,\n itemPlumeType,\n sectionPlumeType,\n invalidChildError,\n requireItemValue,\n ItemComponent,\n SectionComponent,\n ]);\n}\n\nexport function useDerivedItemsFromChildren<T extends React.ReactElement>(\n children: React.ReactNode,\n opts: {\n itemPlumeType: string;\n sectionPlumeType?: string;\n invalidChildError?: string;\n requireItemValue: boolean;\n }\n) {\n const {\n itemPlumeType,\n sectionPlumeType,\n invalidChildError,\n requireItemValue,\n } = opts;\n return React.useMemo(() => {\n return deriveItemsFromChildren<T>(children, {\n itemPlumeType,\n sectionPlumeType,\n invalidChildError,\n requireItemValue,\n });\n }, [\n children,\n itemPlumeType,\n sectionPlumeType,\n invalidChildError,\n requireItemValue,\n ]);\n}\n\n/**\n * Given a Collection node, create the React element that we should use\n * to render it.\n */\nexport function renderCollectionNode(node: Node<any>) {\n // node.rendered should already have our item-like or section-like Plume\n // component elements, so we just need to clone them with a secret\n // _node prop that we use to render.\n return cloneChild(node.rendered as React.ReactElement, {\n _node: node,\n key: node.key,\n });\n}\n\n/**\n * Renders a item-like or section-like Plume component element into an\n * Item or a Section element.\n */\nexport function renderAsCollectionChild<\n T extends React.ReactElement<\n LoaderAwareItemLikeProps | LoaderAwareSectionLikeProps\n >\n>(\n child: T,\n opts: {\n itemPlumeType: string;\n sectionPlumeType?: string;\n }\n) {\n const plumeType = getPlumeType(child);\n if (plumeType === opts.itemPlumeType) {\n const option = child as React.ReactElement<LoaderAwareItemLikeProps>;\n\n // We look at the children passed to the item-like element, and derive key\n // or textValue from it if it is a string\n const content = getChildProp(option, \"children\");\n\n // The children render prop needs to return an <Item/>\n return (\n <Item\n // We use ItemLike.value if the user explicitly specified a value,\n // and we fallback to key. If the user specified neither, then\n // the Collections API will generate a unique key for this item.\n key={getItemLikeKey(option)}\n // textValue is either explicitly specified by the user, or we\n // try to derive it if `content` is a string.\n textValue={\n getChildProp(option, \"textValue\") ??\n (isString(content)\n ? content\n : propInChild(option, \"value\")\n ? getChildProp(option, \"value\")\n : option.key)\n }\n aria-label={getChildProp(option, \"aria-label\")}\n >\n {\n // Note that what we setting the item-like element as the children\n // here, and not content; we want the entire item-like Plume element to\n // end up as Node.rendered.\n }\n {option}\n </Item>\n );\n } else {\n const group = child as React.ReactElement<LoaderAwareSectionLikeProps>;\n return (\n <Section\n // Note that we are using the whole section-like element as the title\n // here, and not group.props.title; we want the entire section-like\n // Plume element to end up as Node.rendered.\n title={group}\n aria-label={getChildProp(group, \"aria-label\")}\n // We are flattening and deriving the descendant Options as items here.\n // group.props.children should've already been cleaned up by\n // deriveItemsFromChildren()\n items={getChildProp(group, \"children\") as React.ReactElement[]}\n >\n {\n // We use the same render function to turn descendent Options into Items\n }\n {(c: React.ReactElement) => renderAsCollectionChild(c, opts)}\n </Section>\n );\n }\n}\n\nfunction getItemLikeKey(element: React.ReactElement<LoaderAwareItemLikeProps>) {\n return getChildProp(element, \"value\") ?? element.key;\n}\n\n// PlasmicLoader-aware function to get prop from child.\nexport function getChildProp(child: React.ReactElement, prop: string) {\n return \"componentProps\" in child.props\n ? child.props.componentProps[prop]\n : child.props[prop];\n}\n\n// PlasmicLoader-aware function to check `if (prop in element.props)`.\nfunction propInChild(child: React.ReactElement, prop: string): boolean {\n return \"componentProps\" in child.props\n ? prop in child.props.componentProps\n : prop in child.props;\n}\n\n// PlasmicLoader-aware function to clone React element.\nfunction cloneChild(child: React.ReactElement, props: Record<string, any>) {\n if ((child.type as any).getPlumeType) {\n // If React element has getPlumeType(), assume that it is PlasmicLoader,\n // so add nodeProps to componentProps instead of element props.\n return React.cloneElement(child, {\n componentProps: {\n ...child.props.componentProps,\n ...props,\n },\n ...(props.key ? { key: props.key } : {}),\n });\n }\n\n return React.cloneElement(child, props);\n}\n"],"names":["React"],"mappings":";;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuDG;AA2Fa,SAAA,oBAAoB,CAClC,KAAU,EACV,IAQC,EAAA;IAED,IAAI,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,SAAS,IAAI,KAAK,EAAE;QAC7C,IAAI,CAAC,IAAI,CAAC,aAAa,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE;AACjD,YAAA,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;AACpE,SAAA;QACD,IAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,SAAS,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CAAC;AAClC,UAAE,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AACxB,CAAC;AAED;AACA,SAAS,WAAW,CAAC,KAAyB,EAAE,IAAY,EAAA;AAC1D,IAAA,OAAO,gBAAgB,IAAI,KAAK,CAAC,KAAK;AACpC,UAAE,IAAI,IAAI,KAAK,CAAC,KAAK,CAAC,cAAc;AACpC,UAAE,IAAI,IAAI,KAAK,CAAC,KAAK,CAAC;AAC1B,CAAC;AAED;AACA,SAAS,UAAU,CAAC,KAAyB,EAAE,KAA0B,EAAA;AACvE,IAAA,IAAK,KAAK,CAAC,IAAY,CAAC,YAAY,EAAE;;;AAGpC,QAAA,OAAOA,cAAK,CAAC,YAAY,CAAC,KAAK,aAC7B,cAAc,EAAA,QAAA,CAAA,QAAA,CAAA,EAAA,EACT,KAAK,CAAC,KAAK,CAAC,cAAc,CAC1B,EAAA,KAAK,MAEN,KAAK,CAAC,GAAG,GAAG,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE,GAAG,EAAE,GACvC,CAAC;AACJ,KAAA;IAED,OAAOA,cAAK,CAAC,YAAY,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAC1C;;;;"}
1
+ {"version":3,"file":"collection-utils-b8088b18.js","sources":["../../src/plume/collection-utils.tsx"],"sourcesContent":["/**\n * In general, we try not to expose react-aria's Collections API to Plume users.\n * The Collections API is how react-aria users pass data about collections of\n * things using the built-in Item and Section components, which are abstract,\n * metadata-only components that don't render anything but only serve to specify\n * data. For example, here's how you would use react-spectrum's Picker:\n *\n * <Picker>\n * <Section title=\"Asia\">\n * <Item key=\"taiwan\">Taiwan</Item>\n * <Item key=\"japan\">Japan</Item>\n * <Item key=\"china\">China</Item>\n * </Section>\n * <Section title=\"Europe\">\n * <Item key=\"germany\">Germany</Item>\n * <Item key=\"france\">France</Item>\n * </Section>\n * </Picker>\n *\n * You would re-use this same Item/Section components to pass similar things to\n * Menu, Tabs, etc.\n *\n * For Plasmic, this API is too abstract. The user has explicitly designed components\n * like Select.Option and Select.OptionGroup, and it is weird that they don't actually\n * use these components. It is more natural to do:\n *\n * <Select>\n * <Select.OptionGroup title=\"Asia\">\n * <Select.Option key=\"taiwan\">Taiwan</Select>\n * </Select.OptionGroup>\n * </Select>\n *\n * For Plume, we let users directly use the components they designed, both to collect\n * information and to perform actual rendering. For example, for Plume,\n * you'd use Select.Option instead of Item, and Select.OptionGroup instead of Section.\n * This means that the Select.Option props will collect the same information Item\n * does.\n *\n * A component like Select.Option then serves two purposes:\n *\n * 1. Allow users to specify the collection of data, like in the above example\n * Here, we're mainly interested in the props in those ReactElements so\n * we can pass the Item/Section data onto react-aria's APIs. We are not\n * actually rendering these elements.\n * 2. Once react-aria's Collections API has gone through them and built\n * Collection \"nodes\", we then create cloned versions of these elements\n * with the corresponding node passed in as a secret prop. These ReactElements\n * are then actually used to _render_ the corresponding Option / OptionGroup.\n *\n * This file contains helper functions to help with implementing the above.\n *\n * Note also that most of the collections-based react-aria components expose\n * a parallel API that accepts a list of \"items\" and a render prop, instead\n * of list of Item/Section elements. This is for efficiency, but we are opting\n * to only support the composite-component pattern for now for simplicity.\n */\n\nimport { Item, Section } from \"@react-stately/collections\";\nimport { Node } from \"@react-types/shared\";\nimport React from \"react\";\nimport { isString } from \"../common\";\nimport { getElementTypeName, toChildArray } from \"../react-utils\";\nimport { getPlumeType, PLUME_STRICT_MODE } from \"./plume-utils\";\n\nexport interface PlasmicLoaderProps<T> {\n component: string;\n componentProps: T;\n}\n\n/**\n * Props for a Plume component that corresponds to an Item\n */\nexport interface ItemLikeProps {\n /**\n * value key corresponding to this item. Not required if you use the\n * `key` prop instead.\n */\n value?: string | null;\n\n /**\n * The text string value corresponding to this item. Used to support\n * keyboard type-ahead. If not specified, then will be derived from\n * `children` if it is a string, or the `value` or `key`.\n */\n textValue?: string;\n\n /**\n * aria-label for this item.\n */\n \"aria-label\"?: string;\n\n /**\n * Primary content label for this item.\n */\n children?: React.ReactNode;\n\n /**\n * If true, this item will not be selectable.\n */\n isDisabled?: boolean;\n}\n\ntype LoaderAwareItemLikeProps =\n | ItemLikeProps\n | PlasmicLoaderProps<ItemLikeProps>;\n\n/**\n * Props for a Plume component that corresponds to a Section\n */\nexport interface SectionLikeProps {\n /**\n * Heading content of the title\n */\n title?: React.ReactNode;\n\n /**\n * aria-label for this section\n */\n \"aria-label\"?: string;\n\n /**\n * A list of items that belong in this group\n */\n children?: React.ReactNode;\n}\n\ntype LoaderAwareSectionLikeProps =\n | SectionLikeProps\n | PlasmicLoaderProps<SectionLikeProps>;\n\nexport type ItemJson = LeafItemJson | SectionJson;\n\nexport type LeafItemJson =\n | string\n | {\n value: string;\n label?: string;\n textValue?: string;\n isDisabled?: boolean;\n };\n\nexport interface SectionJson {\n title: string;\n children: ItemJson[];\n}\n\nexport function deriveItemsFromProps(\n props: any,\n opts: {\n itemPlumeType: string;\n sectionPlumeType?: string;\n invalidChildError?: string;\n requireItemValue: boolean;\n ItemComponent?: React.ComponentType<ItemLikeProps>;\n SectionComponent?: React.ComponentType<SectionLikeProps>;\n itemsProp?: string;\n }\n) {\n if (opts.itemsProp && opts.itemsProp in props) {\n if (!opts.ItemComponent || !opts.SectionComponent) {\n throw new Error(`You may need to re-generate your Plasmic* files`);\n }\n const items = props[opts.itemsProp] as ItemJson[] | undefined;\n return deriveItemsFromItemsProp(items, {\n ItemComponent: opts.ItemComponent,\n SectionComponent: opts.SectionComponent,\n });\n } else {\n return deriveItemsFromChildren(props.children as React.ReactNode, opts);\n }\n}\n\nfunction deriveItemsFromItemsProp(\n items: ItemJson[] | undefined,\n opts: {\n ItemComponent: React.ComponentType<ItemLikeProps>;\n SectionComponent: React.ComponentType<SectionLikeProps>;\n }\n) {\n const { ItemComponent, SectionComponent } = opts;\n const disabledKeys: string[] = [];\n const transform = (item: ItemJson) => {\n if (typeof item === \"string\") {\n return (\n <ItemComponent key={item} value={item}>\n {item}\n </ItemComponent>\n );\n } else if (\"children\" in item) {\n return (\n <SectionComponent key={item.title} title={item.title}>\n {item.children.map((x) => transform(x))}\n </SectionComponent>\n );\n } else {\n if (item.isDisabled) {\n disabledKeys.push(item.value);\n }\n return (\n <ItemComponent\n key={item.value}\n value={item.value}\n textValue={item.textValue}\n isDisabled={item.isDisabled}\n >\n {item.label ?? item.value}\n </ItemComponent>\n );\n }\n };\n return {\n items: items?.map((x) => transform(x)) ?? [],\n disabledKeys,\n };\n}\n\n/**\n * Given children of a component like Select or Menu, derive the items\n * that we will pass into the Collections API. These will be\n * ReactElement<ItemLikeProps|SectionLikeProps>[].\n *\n * Will also assign keys to items by their index in the collection,\n * and collect the keys of disabled items.\n */\nexport function deriveItemsFromChildren<T extends React.ReactElement>(\n children: React.ReactNode,\n opts: {\n itemPlumeType: string;\n sectionPlumeType?: string;\n invalidChildError?: string;\n requireItemValue: boolean;\n }\n) {\n if (!children) {\n return {\n items: [] as T[],\n disabledKeys: [] as React.Key[],\n };\n }\n\n const { itemPlumeType, sectionPlumeType, invalidChildError } = opts;\n\n // For Plume items without an explicit key, we assign a key as the index\n // of the collection.\n let itemCount = 0;\n let sectionCount = 0;\n\n const ensureValue = (element: React.ReactElement) => {\n if (!propInChild(element, \"value\")) {\n if (opts.requireItemValue && PLUME_STRICT_MODE) {\n throw new Error(\n `Must specify a \"value\" prop for ${getElementTypeName(element)}`\n );\n } else {\n return cloneChild(element, { value: `${itemCount++}` });\n }\n } else {\n // Still increment count even if key is present, so that the\n // auto-assigned key really reflects the index\n itemCount++;\n return element;\n }\n };\n\n const disabledKeys: React.Key[] = [];\n\n const flattenedChildren = (\n children: React.ReactNode\n ): React.ReactElement[] => {\n return toChildArray(children).flatMap((child) => {\n if (React.isValidElement(child)) {\n if (child.type === React.Fragment) {\n return flattenedChildren(\n (child as React.ReactElement<{ children: React.ReactNode }>).props\n .children\n );\n }\n const type = getPlumeType(child);\n if (type === itemPlumeType) {\n child = ensureValue(child);\n const childKey = getItemLikeKey(child);\n if (getChildProp(child, \"isDisabled\") && !!childKey) {\n disabledKeys.push(childKey);\n }\n return [child];\n }\n if (type === sectionPlumeType) {\n return [\n cloneChild(child, {\n // key of section doesn't actually matter, just needs\n // to be unique\n key: child.key ?? `section-${sectionCount++}`,\n children: flattenedChildren(getChildProp(child, \"children\")),\n }),\n ];\n }\n }\n\n if (PLUME_STRICT_MODE) {\n throw new Error(invalidChildError ?? `Unexpected child`);\n } else {\n return [];\n }\n });\n };\n\n return { items: flattenedChildren(children) as T[], disabledKeys };\n}\n\nexport function useDerivedItems(\n props: any,\n opts: {\n itemPlumeType: string;\n sectionPlumeType?: string;\n invalidChildError?: string;\n requireItemValue: boolean;\n ItemComponent?: React.ComponentType<ItemLikeProps>;\n SectionComponent?: React.ComponentType<SectionLikeProps>;\n itemsProp?: string;\n }\n) {\n const { children } = props;\n const {\n itemPlumeType,\n sectionPlumeType,\n invalidChildError,\n requireItemValue,\n ItemComponent,\n SectionComponent,\n itemsProp,\n } = opts;\n const items = itemsProp ? props[itemsProp] : undefined;\n return React.useMemo(() => {\n return deriveItemsFromProps(props, {\n itemPlumeType,\n sectionPlumeType,\n invalidChildError,\n requireItemValue,\n itemsProp,\n ItemComponent,\n SectionComponent,\n });\n }, [\n children,\n items,\n itemPlumeType,\n sectionPlumeType,\n invalidChildError,\n requireItemValue,\n ItemComponent,\n SectionComponent,\n ]);\n}\n\nexport function useDerivedItemsFromChildren<T extends React.ReactElement>(\n children: React.ReactNode,\n opts: {\n itemPlumeType: string;\n sectionPlumeType?: string;\n invalidChildError?: string;\n requireItemValue: boolean;\n }\n) {\n const {\n itemPlumeType,\n sectionPlumeType,\n invalidChildError,\n requireItemValue,\n } = opts;\n return React.useMemo(() => {\n return deriveItemsFromChildren<T>(children, {\n itemPlumeType,\n sectionPlumeType,\n invalidChildError,\n requireItemValue,\n });\n }, [\n children,\n itemPlumeType,\n sectionPlumeType,\n invalidChildError,\n requireItemValue,\n ]);\n}\n\n/**\n * Given a Collection node, create the React element that we should use\n * to render it.\n */\nexport function renderCollectionNode(node: Node<any>) {\n // node.rendered should already have our item-like or section-like Plume\n // component elements, so we just need to clone them with a secret\n // _node prop that we use to render.\n return cloneChild(node.rendered as React.ReactElement, {\n _node: node,\n key: node.key,\n });\n}\n\n/**\n * Renders a item-like or section-like Plume component element into an\n * Item or a Section element.\n */\nexport function renderAsCollectionChild<\n T extends React.ReactElement<\n LoaderAwareItemLikeProps | LoaderAwareSectionLikeProps\n >\n>(\n child: T,\n opts: {\n itemPlumeType: string;\n sectionPlumeType?: string;\n }\n) {\n const plumeType = getPlumeType(child);\n if (plumeType === opts.itemPlumeType) {\n const option = child as React.ReactElement<LoaderAwareItemLikeProps>;\n\n // We look at the children passed to the item-like element, and derive key\n // or textValue from it if it is a string\n const content = getChildProp(option, \"children\");\n\n // The children render prop needs to return an <Item/>\n return (\n <Item\n // We use ItemLike.value if the user explicitly specified a value,\n // and we fallback to key. If the user specified neither, then\n // the Collections API will generate a unique key for this item.\n key={getItemLikeKey(option)}\n // textValue is either explicitly specified by the user, or we\n // try to derive it if `content` is a string.\n textValue={\n getChildProp(option, \"textValue\") ??\n (isString(content)\n ? content\n : propInChild(option, \"value\")\n ? getChildProp(option, \"value\")\n : option.key)\n }\n aria-label={getChildProp(option, \"aria-label\")}\n >\n {\n // Note that what we setting the item-like element as the children\n // here, and not content; we want the entire item-like Plume element to\n // end up as Node.rendered.\n }\n {option}\n </Item>\n );\n } else {\n const group = child as React.ReactElement<LoaderAwareSectionLikeProps>;\n return (\n <Section\n // Note that we are using the whole section-like element as the title\n // here, and not group.props.title; we want the entire section-like\n // Plume element to end up as Node.rendered.\n title={group}\n aria-label={getChildProp(group, \"aria-label\")}\n // We are flattening and deriving the descendant Options as items here.\n // group.props.children should've already been cleaned up by\n // deriveItemsFromChildren()\n items={getChildProp(group, \"children\") as React.ReactElement[]}\n >\n {\n // We use the same render function to turn descendent Options into Items\n }\n {(c: React.ReactElement) => renderAsCollectionChild(c, opts)}\n </Section>\n );\n }\n}\n\nfunction getItemLikeKey(element: React.ReactElement<LoaderAwareItemLikeProps>) {\n return getChildProp(element, \"value\") ?? element.key;\n}\n\n// PlasmicLoader-aware function to get prop from child.\nexport function getChildProp(child: React.ReactElement, prop: string) {\n return \"componentProps\" in child.props\n ? child.props.componentProps[prop]\n : child.props[prop];\n}\n\n// PlasmicLoader-aware function to check `if (prop in element.props)`.\nfunction propInChild(child: React.ReactElement, prop: string): boolean {\n return \"componentProps\" in child.props\n ? prop in child.props.componentProps\n : prop in child.props;\n}\n\n// PlasmicLoader-aware function to clone React element.\nfunction cloneChild(child: React.ReactElement, props: Record<string, any>) {\n if ((child.type as any).getPlumeType) {\n // If React element has getPlumeType(), assume that it is PlasmicLoader,\n // so add nodeProps to componentProps instead of element props.\n return React.cloneElement(child, {\n componentProps: {\n ...child.props.componentProps,\n ...props,\n },\n ...(props.key ? { key: props.key } : {}),\n });\n }\n\n return React.cloneElement(child, props);\n}\n"],"names":["React"],"mappings":";;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuDG;AA2Fa,SAAA,oBAAoB,CAClC,KAAU,EACV,IAQC,EAAA;IAED,IAAI,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,SAAS,IAAI,KAAK,EAAE;QAC7C,IAAI,CAAC,IAAI,CAAC,aAAa,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE;AACjD,YAAA,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;AACpE,SAAA;QACD,IAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,SAAS,CAA2B,CAAC;QAC9D,OAAO,wBAAwB,CAAC,KAAK,EAAE;YACrC,aAAa,EAAE,IAAI,CAAC,aAAa;YACjC,gBAAgB,EAAE,IAAI,CAAC,gBAAgB;AACxC,SAAA,CAAC,CAAC;AACJ,KAAA;AAAM,SAAA;QACL,OAAO,uBAAuB,CAAC,KAAK,CAAC,QAA2B,EAAE,IAAI,CAAC,CAAC;AACzE,KAAA;AAC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CAAC,KAAK,CAAC;AAC1B,CAAC;AAED;AACA,SAAS,UAAU,CAAC,KAAyB,EAAE,KAA0B,EAAA;AACvE,IAAA,IAAK,KAAK,CAAC,IAAY,CAAC,YAAY,EAAE;;;AAGpC,QAAA,OAAOA,cAAK,CAAC,YAAY,CAAC,KAAK,aAC7B,cAAc,EAAA,QAAA,CAAA,QAAA,CAAA,EAAA,EACT,KAAK,CAAC,KAAK,CAAC,cAAc,CAC1B,EAAA,KAAK,MAEN,KAAK,CAAC,GAAG,GAAG,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE,GAAG,EAAE,GACvC,CAAC;AACJ,KAAA;IAED,OAAOA,cAAK,CAAC,YAAY,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAC1C;;;;"}
@@ -12,7 +12,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
12
12
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
13
13
  PERFORMANCE OF THIS SOFTWARE.
14
14
  ***************************************************************************** */
15
- /* global Reflect, Promise */
15
+ /* global Reflect, Promise, SuppressedError, Symbol */
16
16
 
17
17
  var extendStatics = function(d, b) {
18
18
  extendStatics = Object.setPrototypeOf ||
@@ -127,7 +127,12 @@ function __spreadArray(to, from, pack) {
127
127
  }
128
128
  }
129
129
  return to.concat(ar || Array.prototype.slice.call(from));
130
- }
130
+ }
131
+
132
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
133
+ var e = new Error(message);
134
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
135
+ };
131
136
 
132
137
  function notNil(x) {
133
138
  return x != null;
@@ -261,4 +266,4 @@ function mapValues(obj, mapper) {
261
266
  }
262
267
 
263
268
  export { __awaiter as _, __assign as a, __generator as b, __rest as c, __spreadArray as d, __read as e, __values as f, chainSingleArgFuncs as g, __extends as h, isSubset as i, ensure as j, isString as k, groupBy as l, mapValues as m, notNil as n, omit as o, pick as p };
264
- //# sourceMappingURL=common-e74df507.js.map
269
+ //# sourceMappingURL=common-7e2bbe30.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common-7e2bbe30.js","sources":["../../src/common.ts"],"sourcesContent":["export function notNil<T>(x: T | undefined | null): x is T {\n return x != null;\n}\n\nexport function pick<T extends {}>(\n obj: T,\n ...keys: (string | number | symbol)[]\n): Partial<T> {\n if (Object.keys(obj).length === 0) {\n return obj;\n }\n const res: any = {};\n for (const key of keys) {\n if (key in obj) {\n res[key] = obj[key as keyof T];\n }\n }\n return res as Partial<T>;\n}\n\nexport function pickBy<T extends {}>(\n obj: T,\n func: (key: string, val: any) => boolean\n): Partial<T> {\n const res: any = {};\n for (const [key, val] of Object.entries(obj)) {\n if (func(key, val)) {\n res[key] = obj[key as keyof T];\n }\n }\n return res as Partial<T>;\n}\n\nexport function omit<T extends {}>(obj: T, ...keys: (keyof T)[]): Partial<T> {\n if (Object.keys(obj).length === 0) {\n return obj;\n }\n const res: Partial<T> = {};\n for (const key of Object.keys(obj) as (keyof T)[]) {\n if (!keys.includes(key)) {\n res[key] = obj[key];\n }\n }\n return res;\n}\n\nexport function isSubset<T>(a1: T[], a2: T[]) {\n return a1.every((x) => a2.includes(x));\n}\n\nexport function chainSingleArgFuncs<A>(...funcs: ((arg: A) => A)[]) {\n if (funcs.length === 0) {\n return undefined;\n }\n return (arg: A) => {\n let res: A = arg;\n for (const func of funcs) {\n res = func(res);\n }\n return res;\n };\n}\n\nexport function ensure<T>(x: T | null | undefined): T {\n if (x === null || x === undefined) {\n debugger;\n throw new Error(`Value must not be undefined or null`);\n } else {\n return x;\n }\n}\n\nexport function isString(x: any): x is string {\n return typeof x === \"string\";\n}\n\nexport function groupBy<T>(\n collection: T[],\n keyFunc: (x: T) => string\n): Record<string, T[]> {\n const result: Record<string, T[]> = {};\n for (const obj of collection) {\n const key = keyFunc(obj);\n if (key in result) {\n result[key].push(obj);\n } else {\n result[key] = [obj];\n }\n }\n return result;\n}\n\nexport function mapValues<V, V2>(\n obj: Record<string, V>,\n mapper: (value: V) => V2\n): Record<string, V2> {\n const result: Record<string, V2> = {};\n for (const key in obj) {\n result[key] = mapper(obj[key]);\n }\n return result;\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAM,SAAU,MAAM,CAAI,CAAuB,EAAA;IAC/C,OAAO,CAAC,IAAI,IAAI,CAAC;AACnB,CAAC;AAEK,SAAU,IAAI,CAClB,GAAM,EAAA;;IACN,IAAqC,IAAA,GAAA,EAAA,CAAA;SAArC,IAAqC,EAAA,GAAA,CAAA,EAArC,EAAqC,GAAA,SAAA,CAAA,MAAA,EAArC,EAAqC,EAAA,EAAA;QAArC,IAAqC,CAAA,EAAA,GAAA,CAAA,CAAA,GAAA,SAAA,CAAA,EAAA,CAAA,CAAA;;IAErC,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE;AACjC,QAAA,OAAO,GAAG,CAAC;AACZ,KAAA;IACD,IAAM,GAAG,GAAQ,EAAE,CAAC;;AACpB,QAAA,KAAkB,IAAA,MAAA,GAAA,QAAA,CAAA,IAAI,CAAA,0BAAA,EAAE,CAAA,QAAA,CAAA,IAAA,EAAA,QAAA,GAAA,MAAA,CAAA,IAAA,EAAA,EAAA;AAAnB,YAAA,IAAM,GAAG,GAAA,QAAA,CAAA,KAAA,CAAA;YACZ,IAAI,GAAG,IAAI,GAAG,EAAE;gBACd,GAAG,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,GAAc,CAAC,CAAC;AAChC,aAAA;AACF,SAAA;;;;;;;;;AACD,IAAA,OAAO,GAAiB,CAAC;AAC3B,CAAC;AAeK,SAAU,IAAI,CAAe,G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,GAAG,CAAC,CAAC;YACzB,IAAI,GAAG,IAAI,MAAM,EAAE;gBACjB,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACvB,aAAA;AAAM,iBAAA;AACL,gBAAA,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AACrB,aAAA;AACF,SAAA;;;;;;;;;AACD,IAAA,OAAO,MAAM,CAAC;AAChB,CAAC;AAEe,SAAA,SAAS,CACvB,GAAsB,EACtB,MAAwB,EAAA;IAExB,IAAM,MAAM,GAAuB,EAAE,CAAC;AACtC,IAAA,KAAK,IAAM,GAAG,IAAI,GAAG,EAAE;QACrB,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;AAChC,KAAA;AACD,IAAA,OAAO,MAAM,CAAC;AAChB;;;;"}
@@ -1,16 +1,16 @@
1
1
  import classNames$1 from 'classnames';
2
+ import { _ as __awaiter, a as __assign, b as __generator, c as __rest, d as __spreadArray, e as __read, o as omit, p as pick, f as __values, i as isSubset, g as chainSingleArgFuncs, n as notNil, h as __extends, j as ensure } from './common-7e2bbe30.js';
2
3
  import { usePlasmicDataSourceContext } from '@plasmicapp/data-sources-context';
3
4
  export { PlasmicDataSourceContextProvider, useCurrentUser } from '@plasmicapp/data-sources-context';
4
5
  import * as React from 'react';
5
6
  import React__default, { useLayoutEffect, useEffect } from 'react';
6
7
  import get from 'dlv';
7
8
  export { default as get } from 'dlv';
8
- import { c as createElementWithChildren, m as mergeProps, e as ensureNotArray, N as NONE, a as mergePropVals, i as isReactNode, b as isBrowser, u as useIsomorphicLayoutEffect$1 } from './react-utils-8796beba.js';
9
- import { _ as __awaiter, a as __assign, b as __generator, c as __rest, d as __spreadArray, e as __read, o as omit, p as pick, f as __values, i as isSubset, g as chainSingleArgFuncs, n as notNil, h as __extends, j as ensure } from './common-e74df507.js';
9
+ import { c as createElementWithChildren, m as mergeProps, e as ensureNotArray, N as NONE, a as mergePropVals, i as isReactNode, b as isBrowser, u as useIsomorphicLayoutEffect$1 } from './react-utils-d266354d.js';
10
10
  export { PlasmicHead, plasmicHeadMeta } from './render/PlasmicHead/index.js';
11
11
  export { PlasmicImg } from './render/PlasmicImg/index.js';
12
- import { T as Trans } from './ssr-90db5fad.js';
13
- export { P as PlasmicLink, a as PlasmicRootProvider, g as genTranslatableString, u as useIsSSR, b as usePlasmicTranslator } from './ssr-90db5fad.js';
12
+ import { T as Trans } from './ssr-145c6cd2.js';
13
+ export { P as PlasmicLink, a as PlasmicRootProvider, g as genTranslatableString, u as useIsSSR, b as usePlasmicTranslator } from './ssr-145c6cd2.js';
14
14
  import ReactDOM__default from 'react-dom';
15
15
  import { useFocusRing } from '@react-aria/focus';
16
16
  import { proxy, useSnapshot, ref, getVersion, subscribe } from 'valtio';
@@ -1,5 +1,5 @@
1
- import { c as __rest, a as __assign, p as pick, d as __spreadArray, e as __read, o as omit } from '../../common-e74df507.js';
2
- import { m as mergeVariantToggles } from '../../plume-utils-3d2c0c98.js';
1
+ import { c as __rest, a as __assign, p as pick, d as __spreadArray, e as __read, o as omit } from '../../common-7e2bbe30.js';
2
+ import { m as mergeVariantToggles } from '../../plume-utils-9472dfe6.js';
3
3
  import 'react';
4
4
 
5
5
  function useButton(plasmicClass, props, config, ref) {
@@ -1,12 +1,12 @@
1
- import { a as __assign, p as pick, d as __spreadArray, e as __read } from '../../common-e74df507.js';
1
+ import { a as __assign, p as pick, d as __spreadArray, e as __read } from '../../common-7e2bbe30.js';
2
2
  import { useCheckbox as useCheckbox$1 } from '@react-aria/checkbox';
3
3
  import { VisuallyHidden } from '@react-aria/visually-hidden';
4
4
  import { useToggleState } from '@react-stately/toggle';
5
5
  import * as React from 'react';
6
- import { m as mergeProps } from '../../react-utils-8796beba.js';
7
- import { c as useEnsureSSRProvider } from '../../ssr-90db5fad.js';
8
- import { m as mergeVariantToggles } from '../../plume-utils-3d2c0c98.js';
9
- import { g as getStyleProps } from '../../props-utils-30c7073a.js';
6
+ import { m as mergeProps } from '../../react-utils-d266354d.js';
7
+ import { c as useEnsureSSRProvider } from '../../ssr-145c6cd2.js';
8
+ import { m as mergeVariantToggles } from '../../plume-utils-9472dfe6.js';
9
+ import { g as getStyleProps } from '../../props-utils-b08721e5.js';
10
10
  import 'classnames';
11
11
  import '@plasmicapp/data-sources-context';
12
12
  import '@react-aria/ssr';
@@ -127,7 +127,7 @@ export declare function deriveItemsFromProps(props: any, opts: {
127
127
  SectionComponent?: React.ComponentType<SectionLikeProps>;
128
128
  itemsProp?: string;
129
129
  }): {
130
- items: JSX.Element[];
130
+ items: React.JSX.Element[];
131
131
  disabledKeys: string[];
132
132
  } | {
133
133
  items: React.ReactElement<any, string | React.JSXElementConstructor<any>>[];
@@ -159,7 +159,7 @@ export declare function useDerivedItems(props: any, opts: {
159
159
  SectionComponent?: React.ComponentType<SectionLikeProps>;
160
160
  itemsProp?: string;
161
161
  }): {
162
- items: JSX.Element[];
162
+ items: React.JSX.Element[];
163
163
  disabledKeys: string[];
164
164
  } | {
165
165
  items: React.ReactElement<any, string | React.JSXElementConstructor<any>>[];
@@ -186,6 +186,6 @@ export declare function renderCollectionNode(node: Node<any>): React.ReactElemen
186
186
  export declare function renderAsCollectionChild<T extends React.ReactElement<LoaderAwareItemLikeProps | LoaderAwareSectionLikeProps>>(child: T, opts: {
187
187
  itemPlumeType: string;
188
188
  sectionPlumeType?: string;
189
- }): JSX.Element;
189
+ }): React.JSX.Element;
190
190
  export declare function getChildProp(child: React.ReactElement, prop: string): any;
191
191
  export {};
@@ -1,12 +1,12 @@
1
- import { a as __assign, p as pick, d as __spreadArray, e as __read, c as __rest } from '../../common-e74df507.js';
1
+ import { a as __assign, p as pick, d as __spreadArray, e as __read, c as __rest } from '../../common-7e2bbe30.js';
2
2
  import { useMenu as useMenu$1, useMenuSection, useMenuItem as useMenuItem$1 } from '@react-aria/menu';
3
3
  import { useTreeState } from '@react-stately/tree';
4
4
  import * as React from 'react';
5
- import { m as mergeProps } from '../../react-utils-8796beba.js';
6
- import { c as useEnsureSSRProvider } from '../../ssr-90db5fad.js';
7
- import { r as renderCollectionNode, u as useDerivedItemsFromChildren, a as renderAsCollectionChild } from '../../collection-utils-12be6625.js';
8
- import { n as noOutline, m as mergeVariantToggles } from '../../plume-utils-3d2c0c98.js';
9
- import { g as getStyleProps } from '../../props-utils-30c7073a.js';
5
+ import { m as mergeProps } from '../../react-utils-d266354d.js';
6
+ import { c as useEnsureSSRProvider } from '../../ssr-145c6cd2.js';
7
+ import { r as renderCollectionNode, u as useDerivedItemsFromChildren, a as renderAsCollectionChild } from '../../collection-utils-b8088b18.js';
8
+ import { n as noOutline, m as mergeVariantToggles } from '../../plume-utils-9472dfe6.js';
9
+ import { g as getStyleProps } from '../../props-utils-b08721e5.js';
10
10
  import { T as TriggeredOverlayContext } from '../../context-e56b6773.js';
11
11
  import { useSeparator } from '@react-aria/separator';
12
12
  import 'classnames';
@@ -31,4 +31,4 @@ export interface DropdownMenuProps {
31
31
  */
32
32
  onOpenChange?: (isOpen: boolean) => void;
33
33
  }
34
- export declare function DropdownMenu(props: DropdownMenuProps): JSX.Element;
34
+ export declare function DropdownMenu(props: DropdownMenuProps): React.JSX.Element;
@@ -1,14 +1,14 @@
1
1
  import * as React from 'react';
2
2
  import { useMenuTriggerState } from '@react-stately/menu';
3
- import { m as mergeProps } from '../../react-utils-8796beba.js';
3
+ import { m as mergeProps } from '../../react-utils-d266354d.js';
4
4
  import { T as TriggeredOverlayContext } from '../../context-e56b6773.js';
5
- import { a as __assign, p as pick, d as __spreadArray, e as __read } from '../../common-e74df507.js';
5
+ import { a as __assign, p as pick, d as __spreadArray, e as __read } from '../../common-7e2bbe30.js';
6
6
  import { useMenuTrigger as useMenuTrigger$1 } from '@react-aria/menu';
7
7
  import { usePress } from '@react-aria/interactions';
8
- import { g as getPlumeType, m as mergeVariantToggles } from '../../plume-utils-3d2c0c98.js';
8
+ import { g as getPlumeType, m as mergeVariantToggles } from '../../plume-utils-9472dfe6.js';
9
9
  import { useFocusable } from '@react-aria/focus';
10
- import { c as useEnsureSSRProvider } from '../../ssr-90db5fad.js';
11
- import { g as getStyleProps } from '../../props-utils-30c7073a.js';
10
+ import { c as useEnsureSSRProvider } from '../../ssr-145c6cd2.js';
11
+ import { g as getStyleProps } from '../../props-utils-b08721e5.js';
12
12
  import 'classnames';
13
13
  import '@plasmicapp/data-sources-context';
14
14
  import '@react-aria/ssr';
@@ -1,15 +1,15 @@
1
- import { a as __assign, p as pick, d as __spreadArray, e as __read, c as __rest } from '../../common-e74df507.js';
1
+ import { a as __assign, p as pick, d as __spreadArray, e as __read, c as __rest } from '../../common-7e2bbe30.js';
2
2
  import { usePlasmicCanvasContext } from '@plasmicapp/host';
3
3
  import { usePress } from '@react-aria/interactions';
4
4
  import { useListBox, useOption, useListBoxSection } from '@react-aria/listbox';
5
5
  import { useSelect as useSelect$1, HiddenSelect } from '@react-aria/select';
6
6
  import { useSelectState } from '@react-stately/select';
7
7
  import * as React from 'react';
8
- import { m as mergeProps, d as mergeRefs } from '../../react-utils-8796beba.js';
9
- import { c as useEnsureSSRProvider } from '../../ssr-90db5fad.js';
10
- import { g as getChildProp, r as renderCollectionNode, b as useDerivedItems, a as renderAsCollectionChild } from '../../collection-utils-12be6625.js';
11
- import { m as mergeVariantToggles, n as noOutline } from '../../plume-utils-3d2c0c98.js';
12
- import { g as getStyleProps } from '../../props-utils-30c7073a.js';
8
+ import { m as mergeProps, d as mergeRefs } from '../../react-utils-d266354d.js';
9
+ import { c as useEnsureSSRProvider } from '../../ssr-145c6cd2.js';
10
+ import { g as getChildProp, r as renderCollectionNode, b as useDerivedItems, a as renderAsCollectionChild } from '../../collection-utils-b8088b18.js';
11
+ import { m as mergeVariantToggles, n as noOutline } from '../../plume-utils-9472dfe6.js';
12
+ import { g as getStyleProps } from '../../props-utils-b08721e5.js';
13
13
  import { T as TriggeredOverlayContext } from '../../context-e56b6773.js';
14
14
  import { useSeparator } from '@react-aria/separator';
15
15
  import 'classnames';
@@ -1,12 +1,12 @@
1
- import { a as __assign, p as pick, d as __spreadArray, e as __read } from '../../common-e74df507.js';
1
+ import { a as __assign, p as pick, d as __spreadArray, e as __read } from '../../common-7e2bbe30.js';
2
2
  import { useSwitch as useSwitch$1 } from '@react-aria/switch';
3
3
  import { VisuallyHidden } from '@react-aria/visually-hidden';
4
4
  import { useToggleState } from '@react-stately/toggle';
5
5
  import * as React from 'react';
6
- import { m as mergeProps } from '../../react-utils-8796beba.js';
7
- import { c as useEnsureSSRProvider } from '../../ssr-90db5fad.js';
8
- import { m as mergeVariantToggles } from '../../plume-utils-3d2c0c98.js';
9
- import { g as getStyleProps } from '../../props-utils-30c7073a.js';
6
+ import { m as mergeProps } from '../../react-utils-d266354d.js';
7
+ import { c as useEnsureSSRProvider } from '../../ssr-145c6cd2.js';
8
+ import { m as mergeVariantToggles } from '../../plume-utils-9472dfe6.js';
9
+ import { g as getStyleProps } from '../../props-utils-b08721e5.js';
10
10
  import 'classnames';
11
11
  import '@plasmicapp/data-sources-context';
12
12
  import '@react-aria/ssr';