@plasmicapp/react-web 0.2.250 → 0.2.251

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 +68 -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 +17 -10
  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
package/dist/all.d.ts CHANGED
@@ -12,11 +12,17 @@ import React__default, { AriaAttributes, DOMAttributes as DOMAttributes$1, AriaR
12
12
  // Michal Adamczyk <https://github.com/mradamczyk>
13
13
  // Marvin Hagemeister <https://github.com/marvinhagemeister>
14
14
 
15
- type Value = string | number | boolean | undefined | null;
16
- type Mapping = { [key: string]: any };
17
- type Argument = Value | Mapping | Argument[];
15
+ declare namespace classNames$1 {
16
+ type Value = string | number | boolean | undefined | null;
17
+ type Mapping = Record<string, unknown>;
18
+ interface ArgumentArray extends Array<Argument> {}
19
+ type Argument = Value | Mapping | ArgumentArray;
20
+ }
18
21
 
19
- declare function classNames$1(...args: Argument[]): string;
22
+ /**
23
+ * A simple JavaScript utility for conditionally joining classNames together.
24
+ */
25
+ declare function classNames$1(...args: classNames$1.ArgumentArray): string;
20
26
 
21
27
  interface PlasmicPageGuardProps {
22
28
  appId: string;
@@ -26,7 +32,7 @@ interface PlasmicPageGuardProps {
26
32
  children: React__default.ReactNode;
27
33
  unauthorizedComp?: React__default.ReactNode;
28
34
  }
29
- declare function PlasmicPageGuard(props: PlasmicPageGuardProps): JSX.Element | null;
35
+ declare function PlasmicPageGuard(props: PlasmicPageGuardProps): React__default.JSX.Element | null;
30
36
  declare function withPlasmicPageGuard<P extends object>(WrappedComponent: React__default.ComponentType<P>, options: Omit<PlasmicPageGuardProps, "children">): React__default.FC<P>;
31
37
 
32
38
  declare function pick<T extends {}>(obj: T, ...keys: (string | number | symbol)[]): Partial<T>;
@@ -12061,7 +12067,7 @@ type PlasmicHeadProps = {
12061
12067
  image?: string;
12062
12068
  canonical?: string;
12063
12069
  };
12064
- declare function PlasmicHead(props: PlasmicHeadProps): JSX.Element | null;
12070
+ declare function PlasmicHead(props: PlasmicHeadProps): React$1.JSX.Element | null;
12065
12071
  declare const plasmicHeadMeta: {
12066
12072
  name: string;
12067
12073
  displayName: string;
@@ -12092,7 +12098,7 @@ declare const plasmicHeadMeta: {
12092
12098
 
12093
12099
  declare function PlasmicIcon(props: React$1.ComponentProps<"svg"> & {
12094
12100
  PlasmicIconType: React$1.ComponentType;
12095
- }): JSX.Element;
12101
+ }): React$1.JSX.Element;
12096
12102
 
12097
12103
  /**
12098
12104
  * Responsive `<img/>` replacement, based on `next/image`
@@ -12175,18 +12181,18 @@ interface PlasmicImgProps extends ImgTagProps {
12175
12181
  }
12176
12182
  declare const PlasmicImg: React__default.ForwardRefExoticComponent<PlasmicImgProps & React__default.RefAttributes<HTMLElement>>;
12177
12183
 
12178
- declare const PlasmicLink: React__default.ForwardRefExoticComponent<Pick<any, string | number | symbol> & React__default.RefAttributes<any>>;
12184
+ declare const PlasmicLink: React__default.ForwardRefExoticComponent<Omit<any, "ref"> & React__default.RefAttributes<any>>;
12179
12185
 
12180
12186
  declare function PlasmicSlot<T extends keyof JSX.IntrinsicElements = "div">(props: React$1.ComponentProps<T> & {
12181
12187
  as?: T;
12182
12188
  defaultContents?: React$1.ReactNode;
12183
12189
  value?: React$1.ReactNode;
12184
- }): JSX.Element | null;
12190
+ }): React$1.JSX.Element | null;
12185
12191
  declare function renderPlasmicSlot<T extends keyof JSX.IntrinsicElements = "div">(opts: {
12186
12192
  as?: T;
12187
12193
  defaultContents?: React$1.ReactNode;
12188
12194
  value?: React$1.ReactNode;
12189
- }): JSX.Element | null;
12195
+ }): React$1.JSX.Element | null;
12190
12196
 
12191
12197
  type Queries = {
12192
12198
  [name: string]: string;
@@ -12263,7 +12269,7 @@ interface PlasmicRootProviderProps extends PlasmicDataSourceContextValue {
12263
12269
  disableLoadingBoundary?: boolean;
12264
12270
  suspenseFallback?: React$1.ReactNode;
12265
12271
  }
12266
- declare function PlasmicRootProvider(props: PlasmicRootProviderProps): JSX.Element;
12272
+ declare function PlasmicRootProvider(props: PlasmicRootProviderProps): React$1.JSX.Element;
12267
12273
  declare const useIsSSR: typeof useIsSSR$1;
12268
12274
 
12269
12275
  declare const Stack: (<T extends keyof JSX.IntrinsicElements = "div">(props: {
@@ -12380,6 +12386,13 @@ interface FocusableDOMProps extends DOMProps {
12380
12386
  excludeFromTabOrder?: boolean
12381
12387
  }
12382
12388
 
12389
+ interface InputDOMProps {
12390
+ /**
12391
+ * The name of the input element, used when submitting an HTML form. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefname).
12392
+ */
12393
+ name?: string
12394
+ }
12395
+
12383
12396
  /** Any focusable element, including both HTML and SVG elements. */
12384
12397
  interface FocusableElement extends Element, HTMLOrSVGElement {}
12385
12398
 
@@ -12409,13 +12422,12 @@ interface DOMAttributes<T = FocusableElement> extends AriaAttributes, DOMAttribu
12409
12422
  type ValidationState = 'valid' | 'invalid';
12410
12423
 
12411
12424
  interface Validation {
12412
- /** Whether the input should display its "valid" or "invalid" visual styling. */
12413
- validationState?: ValidationState,
12414
- /**
12415
- * Whether user input is required on the input before form submission.
12416
- * Often paired with the `necessityIndicator` prop to add a visual indicator to the input.
12417
- */
12418
- isRequired?: boolean
12425
+ /** Whether user input is required on the input before form submission. */
12426
+ isRequired?: boolean,
12427
+ /** Whether the input value is invalid. */
12428
+ isInvalid?: boolean,
12429
+ /** @deprecated Use `isInvalid` instead. */
12430
+ validationState?: ValidationState
12419
12431
  }
12420
12432
 
12421
12433
  interface InputBase {
@@ -12472,10 +12484,10 @@ interface Collection<T> extends Iterable<T> {
12472
12484
  getKeys(): Iterable<Key>,
12473
12485
 
12474
12486
  /** Get an item by its key. */
12475
- getItem(key: Key): T,
12487
+ getItem(key: Key): T | null,
12476
12488
 
12477
12489
  /** Get an item by the index of its key. */
12478
- at(idx: number): T,
12490
+ at(idx: number): T | null,
12479
12491
 
12480
12492
  /** Get the key that comes before the given key in the collection. */
12481
12493
  getKeyBefore(key: Key): Key | null,
@@ -12487,7 +12499,13 @@ interface Collection<T> extends Iterable<T> {
12487
12499
  getFirstKey(): Key | null,
12488
12500
 
12489
12501
  /** Get the last key in the collection. */
12490
- getLastKey(): Key | null
12502
+ getLastKey(): Key | null,
12503
+
12504
+ /** Iterate over the child items of the given key. */
12505
+ getChildren?(key: Key): Iterable<T>,
12506
+
12507
+ /** Returns a string representation of the item's contents. */
12508
+ getTextValue?(key: Key): string
12491
12509
  }
12492
12510
 
12493
12511
  interface Node<T> {
@@ -12496,12 +12514,15 @@ interface Node<T> {
12496
12514
  /** A unique key for the node. */
12497
12515
  key: Key,
12498
12516
  /** The object value the node was created from. */
12499
- value: T,
12517
+ value: T | null,
12500
12518
  /** The level of depth this node is at in the heirarchy. */
12501
12519
  level: number,
12502
12520
  /** Whether this item has children, even if not loaded yet. */
12503
12521
  hasChildNodes: boolean,
12504
- /** The loaded children of this node. */
12522
+ /**
12523
+ * The loaded children of this node.
12524
+ * @deprecated Use `collection.getChildren(node.key)` instead.
12525
+ */
12505
12526
  childNodes: Iterable<Node<T>>,
12506
12527
  /** The rendered contents of this node (e.g. JSX). */
12507
12528
  rendered: ReactNode,
@@ -12514,11 +12535,11 @@ interface Node<T> {
12514
12535
  /** A function that should be called to wrap the rendered node. */
12515
12536
  wrapper?: (element: ReactElement) => ReactElement,
12516
12537
  /** The key of the parent node. */
12517
- parentKey?: Key,
12538
+ parentKey?: Key | null,
12518
12539
  /** The key of the node before this node. */
12519
- prevKey?: Key,
12540
+ prevKey?: Key | null,
12520
12541
  /** The key of the node after this node. */
12521
- nextKey?: Key,
12542
+ nextKey?: Key | null,
12522
12543
  /** Additional properties specific to a particular node type. */
12523
12544
  props?: any,
12524
12545
  /** @private */
@@ -12542,7 +12563,9 @@ interface Node<T> {
12542
12563
  // Event bubbling can be problematic in real-world applications, so the default for React Spectrum components
12543
12564
  // is not to propagate. This can be overridden by calling continuePropagation() on the event.
12544
12565
  type BaseEvent<T extends SyntheticEvent> = T & {
12545
- /** @deprecated Use continuePropagation. */
12566
+ /**
12567
+ * Use continuePropagation.
12568
+ * @deprecated */
12546
12569
  stopPropagation(): void,
12547
12570
  continuePropagation(): void
12548
12571
  }
@@ -12565,10 +12588,16 @@ interface PressEvent {
12565
12588
  /** Whether the meta keyboard modifier was held during the press event. */
12566
12589
  metaKey: boolean,
12567
12590
  /** Whether the alt keyboard modifier was held during the press event. */
12568
- altKey: boolean
12591
+ altKey: boolean,
12592
+ /**
12593
+ * By default, press events stop propagation to parent elements.
12594
+ * In cases where a handler decides not to handle a specific event,
12595
+ * it can call `continuePropagation()` to allow a parent to handle it.
12596
+ */
12597
+ continuePropagation(): void
12569
12598
  }
12570
12599
 
12571
- interface LongPressEvent extends Omit<PressEvent, 'type'> {
12600
+ interface LongPressEvent extends Omit<PressEvent, 'type' | 'continuePropagation'> {
12572
12601
  /** The type of long press event being fired. */
12573
12602
  type: 'longpressstart' | 'longpressend' | 'longpress'
12574
12603
  }
@@ -12580,16 +12609,16 @@ interface KeyboardEvents {
12580
12609
  onKeyUp?: (e: KeyboardEvent) => void
12581
12610
  }
12582
12611
 
12583
- interface FocusEvents {
12612
+ interface FocusEvents<Target = Element> {
12584
12613
  /** Handler that is called when the element receives focus. */
12585
- onFocus?: (e: FocusEvent) => void,
12614
+ onFocus?: (e: FocusEvent<Target>) => void,
12586
12615
  /** Handler that is called when the element loses focus. */
12587
- onBlur?: (e: FocusEvent) => void,
12616
+ onBlur?: (e: FocusEvent<Target>) => void,
12588
12617
  /** Handler that is called when the element's focus status changes. */
12589
12618
  onFocusChange?: (isFocused: boolean) => void
12590
12619
  }
12591
12620
 
12592
- interface FocusableProps extends FocusEvents, KeyboardEvents {
12621
+ interface FocusableProps<Target = Element> extends FocusEvents<Target>, KeyboardEvents {
12593
12622
  /** Whether the element should receive focus on render. */
12594
12623
  autoFocus?: boolean
12595
12624
  }
@@ -12740,14 +12769,10 @@ interface ToggleProps extends InputBase, Validation, FocusableProps {
12740
12769
  /**
12741
12770
  * The value of the input element, used when submitting an HTML form. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefvalue).
12742
12771
  */
12743
- value?: string,
12744
- /**
12745
- * The name of the input element, used when submitting an HTML form. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefname).
12746
- */
12747
- name?: string
12772
+ value?: string
12748
12773
  }
12749
12774
 
12750
- interface AriaToggleProps extends ToggleProps, FocusableDOMProps, AriaLabelingProps, AriaValidationProps {
12775
+ interface AriaToggleProps extends ToggleProps, FocusableDOMProps, AriaLabelingProps, AriaValidationProps, InputDOMProps {
12751
12776
  /**
12752
12777
  * Identifies the element (or elements) whose contents or presence are controlled by the current element.
12753
12778
  */
@@ -13053,7 +13078,7 @@ interface DropdownMenuProps {
13053
13078
  */
13054
13079
  onOpenChange?: (isOpen: boolean) => void;
13055
13080
  }
13056
- declare function DropdownMenu(props: DropdownMenuProps): JSX.Element;
13081
+ declare function DropdownMenu(props: DropdownMenuProps): React$1.JSX.Element;
13057
13082
 
13058
13083
  interface BaseMenuButtonProps extends DOMProps, FocusableProps, StyleProps, Pick<React$1.ComponentProps<"button">, "title"> {
13059
13084
  /**
@@ -13387,7 +13412,7 @@ declare class SelectionManager implements MultipleSelectionManager {
13387
13412
  /**
13388
13413
  * Sets the focused key.
13389
13414
  */
13390
- setFocusedKey(key: Key, childFocusStrategy?: FocusStrategy): void;
13415
+ setFocusedKey(key: Key | null, childFocusStrategy?: FocusStrategy): void;
13391
13416
  /**
13392
13417
  * The currently selected keys in the collection.
13393
13418
  */
@@ -13495,14 +13520,10 @@ interface SwitchBase extends InputBase, FocusableProps {
13495
13520
  /**
13496
13521
  * The value of the input element, used when submitting an HTML form. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefvalue).
13497
13522
  */
13498
- value?: string,
13499
- /**
13500
- * The name of the input element, used when submitting an HTML form. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefname).
13501
- */
13502
- name?: string
13523
+ value?: string
13503
13524
  }
13504
13525
  interface SwitchProps$1 extends SwitchBase {}
13505
- interface AriaSwitchBase extends SwitchBase, FocusableDOMProps, AriaLabelingProps {
13526
+ interface AriaSwitchBase extends SwitchBase, FocusableDOMProps, InputDOMProps, AriaLabelingProps {
13506
13527
  /**
13507
13528
  * Identifies the element (or elements) whose contents or presence are controlled by the current element.
13508
13529
  */
@@ -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/dist/index.cjs.js CHANGED
@@ -61,7 +61,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
61
61
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
62
62
  PERFORMANCE OF THIS SOFTWARE.
63
63
  ***************************************************************************** */
64
- /* global Reflect, Promise */
64
+ /* global Reflect, Promise, SuppressedError, Symbol */
65
65
 
66
66
  var extendStatics = function(d, b) {
67
67
  extendStatics = Object.setPrototypeOf ||
@@ -176,7 +176,12 @@ function __spreadArray(to, from, pack) {
176
176
  }
177
177
  }
178
178
  return to.concat(ar || Array.prototype.slice.call(from));
179
- }
179
+ }
180
+
181
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
182
+ var e = new Error(message);
183
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
184
+ };
180
185
 
181
186
  // https://stackoverflow.com/a/2117523
182
187
  function uuidv4() {