@plasmicpkgs/react-aria 0.0.82 → 0.0.83

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 (48) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/react-aria.esm.js +38 -36
  3. package/dist/react-aria.esm.js.map +1 -1
  4. package/dist/react-aria.js +38 -36
  5. package/dist/react-aria.js.map +1 -1
  6. package/package.json +2 -2
  7. package/skinny/{common-4b974d89.cjs.js → common-1e5dba7d.cjs.js} +2 -2
  8. package/skinny/common-1e5dba7d.cjs.js.map +1 -0
  9. package/skinny/{common-1a6affb0.esm.js → common-a8f4a4b1.esm.js} +2 -2
  10. package/skinny/common-a8f4a4b1.esm.js.map +1 -0
  11. package/skinny/registerButton.cjs.js +21 -29
  12. package/skinny/registerButton.cjs.js.map +1 -1
  13. package/skinny/registerButton.esm.js +21 -29
  14. package/skinny/registerButton.esm.js.map +1 -1
  15. package/skinny/registerCheckbox.cjs.js +1 -1
  16. package/skinny/registerCheckbox.esm.js +1 -1
  17. package/skinny/registerCheckboxGroup.cjs.js +1 -1
  18. package/skinny/registerCheckboxGroup.esm.js +1 -1
  19. package/skinny/registerComboBox.cjs.js +2 -2
  20. package/skinny/registerComboBox.esm.js +2 -2
  21. package/skinny/registerDialogTrigger.cjs.js +1 -1
  22. package/skinny/registerDialogTrigger.esm.js +1 -1
  23. package/skinny/registerInput.cjs.js +1 -1
  24. package/skinny/registerInput.esm.js +1 -1
  25. package/skinny/registerModal.cjs.js +7 -7
  26. package/skinny/registerModal.cjs.js.map +1 -1
  27. package/skinny/registerModal.esm.js +8 -8
  28. package/skinny/registerModal.esm.js.map +1 -1
  29. package/skinny/registerRadio.cjs.js +1 -1
  30. package/skinny/registerRadio.esm.js +1 -1
  31. package/skinny/registerRadioGroup.cjs.js +1 -1
  32. package/skinny/registerRadioGroup.esm.js +1 -1
  33. package/skinny/registerSelect.cjs.js +13 -3
  34. package/skinny/registerSelect.cjs.js.map +1 -1
  35. package/skinny/registerSelect.esm.js +13 -3
  36. package/skinny/registerSelect.esm.js.map +1 -1
  37. package/skinny/registerSlider.cjs.js +1 -1
  38. package/skinny/registerSlider.esm.js +1 -1
  39. package/skinny/registerSliderThumb.cjs.js +1 -1
  40. package/skinny/registerSliderThumb.esm.js +1 -1
  41. package/skinny/registerSwitch.cjs.js +1 -1
  42. package/skinny/registerSwitch.esm.js +1 -1
  43. package/skinny/registerTextArea.cjs.js +1 -1
  44. package/skinny/registerTextArea.esm.js +1 -1
  45. package/skinny/registerTextField.cjs.js +1 -1
  46. package/skinny/registerTextField.esm.js +1 -1
  47. package/skinny/common-1a6affb0.esm.js.map +0 -1
  48. package/skinny/common-4b974d89.cjs.js.map +0 -1
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
- var host = require('@plasmicapp/host');
4
3
  var React = require('react');
5
4
  var reactAria = require('react-aria');
6
5
  var reactAriaComponents = require('react-aria-components');
6
+ var host = require('@plasmicapp/host');
7
7
  var registerComponent = require('@plasmicapp/host/registerComponent');
8
8
  var utils = require('@react-aria/utils');
9
9
  var flattenChildren = require('react-keyed-flatten-children');
@@ -179,7 +179,7 @@ function createAriaLabelProp(componentName) {
179
179
  return {
180
180
  type: "string",
181
181
  displayName: "ARIA label",
182
- description: `Label for this ${componentName}, if no visible label is used, to identify the element to assistive technology`,
182
+ description: `Assistive technology uses this if there is no visible label for this ${componentName}`,
183
183
  advanced: true,
184
184
  hidden: hasParent
185
185
  };
@@ -563,33 +563,25 @@ const BUTTON_VARIANTS = [
563
563
  "disabled"
564
564
  ];
565
565
  const { variants: variants$f, withObservedValues: withObservedValues$d } = pickAriaComponentVariants(BUTTON_VARIANTS);
566
- const BaseButton = React__default.default.forwardRef(
567
- (props, ref) => {
568
- var _b;
569
- const _a = props, { submitsForm, resetsForm, children, plasmicUpdateVariant } = _a, rest = __objRest$m(_a, ["submitsForm", "resetsForm", "children", "plasmicUpdateVariant"]);
570
- const canvasContext = (_b = host.usePlasmicCanvasContext) == null ? void 0 : _b();
571
- const isEditMode = canvasContext && canvasContext.interactive === false;
572
- const type = submitsForm ? "submit" : resetsForm ? "reset" : "button";
573
- const mergedProps = reactAria.mergeProps(rest, {
574
- type,
575
- ref,
576
- // The rich text editor can cancel effect of clicks/hover, but not of key strokes.
577
- // When pressing space key, the button's "pressed" state is triggered, and the rich text editor loses focus as a result.
578
- preventFocusOnPress: isEditMode
579
- });
580
- return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Button, __spreadValues$p({}, mergedProps), ({ isHovered, isPressed, isFocused, isFocusVisible, isDisabled }) => withObservedValues$d(
581
- children,
582
- {
583
- hovered: isHovered,
584
- pressed: isPressed,
585
- focused: isFocused,
586
- focusVisible: isFocusVisible,
587
- disabled: isDisabled
588
- },
589
- plasmicUpdateVariant
590
- ));
591
- }
592
- );
566
+ const BaseButton = React__default.default.forwardRef(function BaseButtonInner(props, ref) {
567
+ const _a = props, { submitsForm, resetsForm, children, plasmicUpdateVariant } = _a, rest = __objRest$m(_a, ["submitsForm", "resetsForm", "children", "plasmicUpdateVariant"]);
568
+ const type = submitsForm ? "submit" : resetsForm ? "reset" : "button";
569
+ const mergedProps = reactAria.mergeProps(rest, {
570
+ type,
571
+ ref
572
+ });
573
+ return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Button, __spreadValues$p({}, mergedProps), ({ isHovered, isPressed, isFocused, isFocusVisible, isDisabled }) => withObservedValues$d(
574
+ children,
575
+ {
576
+ hovered: isHovered,
577
+ pressed: isPressed,
578
+ focused: isFocused,
579
+ focusVisible: isFocusVisible,
580
+ disabled: isDisabled
581
+ },
582
+ plasmicUpdateVariant
583
+ ));
584
+ });
593
585
  const BUTTON_COMPONENT_NAME = makeComponentName("button");
594
586
  function registerButton(loader, overrides) {
595
587
  registerComponentHelper(
@@ -2467,7 +2459,7 @@ const INLINE_STYLES = {
2467
2459
  outline: "none"
2468
2460
  };
2469
2461
  const BaseModal = React.forwardRef(
2470
- function _BaseModal(props, ref) {
2462
+ function BaseModalInner(props, ref) {
2471
2463
  var _b, _c, _d;
2472
2464
  const _a = props, {
2473
2465
  children,
@@ -2486,6 +2478,8 @@ const BaseModal = React.forwardRef(
2486
2478
  "setControlContextData",
2487
2479
  "isDismissable"
2488
2480
  ]);
2481
+ const canvasCtx = host.usePlasmicCanvasContext();
2482
+ const isEditMode = canvasCtx && canvasCtx.interactive === false;
2489
2483
  const isSelected = (_d = (_c = (_b = host.usePlasmicCanvasComponentInfo) == null ? void 0 : _b(props)) == null ? void 0 : _c.isSelected) != null ? _d : false;
2490
2484
  const contextProps = React__default.default.useContext(PlasmicDialogTriggerContext);
2491
2485
  const isStandalone = !contextProps;
@@ -2496,10 +2490,9 @@ const BaseModal = React.forwardRef(
2496
2490
  1. Clicking anywhere inside the modal dismisses it
2497
2491
  2. If the modal is auto-opened due to selection in outline tab, the modal stays open despite issue #1, but the text elements inside the modal are no longer selectable, and therefore the text or headings inside the modal are not editable.
2498
2492
 
2499
- To fix the above issue, we set an interim isDismissable state to false while the modal is auto-open (`isSelected` is true).
2500
- Also note that `isSelected` can only be true in canvas (non-interactive mode), so we can safely (temporarily) set `isDismissable` to false in this case, because it only matters in interactive mode.
2493
+ To fix the above issue, we set an interim isDismissable state to false in edit mode, because it only matters in interactive mode.
2501
2494
  */
2502
- isDismissable: isSelected ? false : isDismissable
2495
+ isDismissable: isEditMode ? false : isDismissable
2503
2496
  });
2504
2497
  setControlContextData == null ? void 0 : setControlContextData({
2505
2498
  parent: isStandalone ? void 0 : {}
@@ -2514,7 +2507,6 @@ const BaseModal = React.forwardRef(
2514
2507
  (_a2 = mergedProps.onOpenChange) == null ? void 0 : _a2.call(mergedProps, true);
2515
2508
  }
2516
2509
  }));
2517
- const isCanvas = host.usePlasmicCanvasContext();
2518
2510
  const bodyInCanvas = /* @__PURE__ */ React__default.default.createElement("div", { style: INLINE_STYLES }, children);
2519
2511
  const bodyInPreview = /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Dialog, { style: INLINE_STYLES }, children);
2520
2512
  return /* @__PURE__ */ React__default.default.createElement(
@@ -2522,7 +2514,7 @@ const BaseModal = React.forwardRef(
2522
2514
  __spreadProps$8(__spreadValues$c({}, mergedProps), {
2523
2515
  className: `${resetClassName} ${modalOverlayClass}`
2524
2516
  }),
2525
- /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Modal, { className }, isCanvas ? bodyInCanvas : bodyInPreview)
2517
+ /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Modal, { className }, canvasCtx ? bodyInCanvas : bodyInPreview)
2526
2518
  );
2527
2519
  }
2528
2520
  );
@@ -3065,7 +3057,17 @@ var __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b));
3065
3057
  function SelectAutoOpen(props) {
3066
3058
  var _a;
3067
3059
  const { open, close } = (_a = React__default.default.useContext(reactAriaComponents.SelectStateContext)) != null ? _a : {};
3068
- useAutoOpen({ props, open, close });
3060
+ useAutoOpen({
3061
+ props,
3062
+ open: () => {
3063
+ open == null ? void 0 : open();
3064
+ setTimeout(() => {
3065
+ var _a2, _b;
3066
+ (_b = (_a2 = window.parent.document.activeElement) == null ? void 0 : _a2.blur) == null ? void 0 : _b.call(_a2);
3067
+ });
3068
+ },
3069
+ close
3070
+ });
3069
3071
  return null;
3070
3072
  }
3071
3073
  const BaseSelectValue = (props) => {