@peers-app/peers-ui 0.34.5 → 0.34.7

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 (36) hide show
  1. package/dist/components/group-switcher.js +30 -2
  2. package/dist/components/markdown-editor/editor.d.ts +5 -4
  3. package/dist/components/markdown-editor/editor.js +10 -145
  4. package/dist/components/markdown-editor/lexical-editor.d.ts +3 -0
  5. package/dist/components/markdown-editor/lexical-editor.js +153 -0
  6. package/dist/components/markdown-render.d.ts +8 -0
  7. package/dist/components/markdown-render.js +143 -0
  8. package/dist/components/markdown-with-mentions.d.ts +1 -1
  9. package/dist/components/markdown-with-mentions.js +7 -129
  10. package/dist/components/trust-level-dropdown.d.ts +6 -1
  11. package/dist/components/trust-level-dropdown.js +43 -14
  12. package/dist/components/use-close-on-outside-press.d.ts +19 -0
  13. package/dist/components/use-close-on-outside-press.js +54 -0
  14. package/dist/isolated-screens/focus-relay.d.ts +24 -0
  15. package/dist/isolated-screens/focus-relay.js +104 -0
  16. package/dist/isolated-screens/frame-document.d.ts +7 -0
  17. package/dist/isolated-screens/frame-document.js +11 -1
  18. package/dist/isolated-screens/frame-protocol.d.ts +26 -0
  19. package/dist/isolated-screens/frame-protocol.js +21 -0
  20. package/dist/isolated-screens/frame-runtime.js +47 -14
  21. package/dist/isolated-screens/isolated-screen.d.ts +6 -0
  22. package/dist/isolated-screens/isolated-screen.js +40 -3
  23. package/dist/isolated-screens/piece-frames.js +57 -5
  24. package/dist/isolated-screens/piece-reach.js +17 -6
  25. package/dist/lazy-module.d.ts +17 -0
  26. package/dist/lazy-module.js +26 -0
  27. package/dist/notifications/notification-bell.js +2 -18
  28. package/dist/operator-console/console-session.js +1 -9
  29. package/dist/screens/groups/group-members.js +7 -17
  30. package/dist/screens/invites/accept-invite.js +15 -4
  31. package/dist/tabs-layout/network-status-indicator.js +2 -21
  32. package/dist/theme.css +8 -0
  33. package/dist/ui-contracts/piece-height.d.ts +8 -2
  34. package/dist/ui-contracts/piece-height.js +6 -1
  35. package/dist/ui-contracts/piece.js +1 -1
  36. package/package.json +4 -3
@@ -10,6 +10,7 @@ const react_1 = require("react");
10
10
  const app_update_controls_1 = require("../app-updates/app-update-controls");
11
11
  const app_updates_consumer_1 = require("../app-updates/app-updates-consumer");
12
12
  const use_app_update_status_1 = require("../app-updates/use-app-update-status");
13
+ const use_close_on_outside_press_1 = require("../components/use-close-on-outside-press");
13
14
  const notification_bell_1 = require("../notifications/notification-bell");
14
15
  const identity_routes_1 = require("../screens/identity/identity-routes");
15
16
  const network_viewer_section_1 = require("../screens/network-viewer/network-viewer-section");
@@ -222,27 +223,7 @@ function NetworkStatusIndicator({ compact = false }) {
222
223
  syncingLongerThanGreenMs,
223
224
  holdSyncingVisual,
224
225
  }), appUpdate);
225
- (0, react_1.useEffect)(() => {
226
- if (!open) {
227
- return;
228
- }
229
- const closeOutside = (event) => {
230
- if (!containerRef.current?.contains(event.target)) {
231
- setOpen(false);
232
- }
233
- };
234
- const closeOnEscape = (event) => {
235
- if (event.key === "Escape") {
236
- setOpen(false);
237
- }
238
- };
239
- document.addEventListener("mousedown", closeOutside);
240
- document.addEventListener("keydown", closeOnEscape);
241
- return () => {
242
- document.removeEventListener("mousedown", closeOutside);
243
- document.removeEventListener("keydown", closeOnEscape);
244
- };
245
- }, [open]);
226
+ (0, use_close_on_outside_press_1.useCloseOnOutsidePress)(containerRef, open, () => setOpen(false));
246
227
  return ((0, jsx_runtime_1.jsxs)("div", { ref: containerRef, className: "position-relative d-flex align-items-center", children: [(0, jsx_runtime_1.jsxs)("button", { type: "button", className: `btn btn-sm d-flex align-items-center gap-1 px-2 ${presentation.colorClass}`, style: {
247
228
  border: "none",
248
229
  background: "transparent",
package/dist/theme.css CHANGED
@@ -106,6 +106,14 @@
106
106
  app-region: drag;
107
107
  }
108
108
 
109
+ /* While a shell popover is open (the bell's, the network status; useCloseOnOutsidePress), the
110
+ strip doesn't move the window: a press on its empty space then reaches the page and closes
111
+ the popover, as a press beside a native menu does. */
112
+ .peers-window-draggable.peers-window-drag-paused .peers-tab-strip {
113
+ -webkit-app-region: no-drag;
114
+ app-region: no-drag;
115
+ }
116
+
109
117
  .peers-window-draggable
110
118
  .peers-tab-strip
111
119
  :is(
@@ -1,9 +1,10 @@
1
+ import type React from "react";
1
2
  /**
2
3
  * How the box a piece draws in is sized: `fill` for a view that fills its embedder's box,
3
4
  * `content` for one that takes its own height, and for a popover. A piece drawn in a frame of its
4
5
  * own reads it to know whether to report its height.
5
6
  */
6
- export declare const PieceHeightContext: import("react").Context<"fill" | "content">;
7
+ export declare const PieceHeightContext: React.Context<"fill" | "content">;
7
8
  /** The size of the box a piece draws in. */
8
9
  export interface IPieceSize {
9
10
  /** Width in CSS pixels. */
@@ -15,4 +16,9 @@ export interface IPieceSize {
15
16
  * The measured size of the box a piece draws in, which `usePieceSize` reads. `<Piece>` measures
16
17
  * its box; a piece drawn in a frame of its own is measured inside that frame.
17
18
  */
18
- export declare const PieceSizeContext: import("react").Context<IPieceSize>;
19
+ export declare const PieceSizeContext: React.Context<IPieceSize>;
20
+ /**
21
+ * The embedder's `loading` view for the piece drawn here. A piece drawn in a frame of its own
22
+ * keeps showing it until that frame has drawn the piece.
23
+ */
24
+ export declare const PieceLoadingContext: React.Context<(() => React.ReactNode) | undefined>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PieceSizeContext = exports.PieceHeightContext = void 0;
3
+ exports.PieceLoadingContext = exports.PieceSizeContext = exports.PieceHeightContext = void 0;
4
4
  const react_1 = require("react");
5
5
  /**
6
6
  * How the box a piece draws in is sized: `fill` for a view that fills its embedder's box,
@@ -13,3 +13,8 @@ exports.PieceHeightContext = (0, react_1.createContext)("content");
13
13
  * its box; a piece drawn in a frame of its own is measured inside that frame.
14
14
  */
15
15
  exports.PieceSizeContext = (0, react_1.createContext)({ width: 0, height: 0 });
16
+ /**
17
+ * The embedder's `loading` view for the piece drawn here. A piece drawn in a frame of its own
18
+ * keeps showing it until that frame has drawn the piece.
19
+ */
20
+ exports.PieceLoadingContext = (0, react_1.createContext)(undefined);
@@ -225,7 +225,7 @@ function Piece(props) {
225
225
  return unavailable({ reason: "failed", message: checked.error, retry });
226
226
  }
227
227
  const Component = current.component;
228
- const body = ((0, jsx_runtime_1.jsx)(PieceErrorBoundary, { resetKey: Component, name: props.of.name, onRetry: retry, render: (value) => unavailable(value, true), children: (0, jsx_runtime_1.jsx)(PieceAncestry.Provider, { value: inside, children: (0, jsx_runtime_1.jsx)(Component, { props: checked?.value ?? {}, emit: emit ?? {}, close: () => closeRef.current?.(), groupId: available.dataContextId }) }) }, attempt));
228
+ const body = ((0, jsx_runtime_1.jsx)(PieceErrorBoundary, { resetKey: Component, name: props.of.name, onRetry: retry, render: (value) => unavailable(value, true), children: (0, jsx_runtime_1.jsx)(PieceAncestry.Provider, { value: inside, children: (0, jsx_runtime_1.jsx)(piece_height_1.PieceLoadingContext.Provider, { value: props.loading, children: (0, jsx_runtime_1.jsx)(Component, { props: checked?.value ?? {}, emit: emit ?? {}, close: () => closeRef.current?.(), groupId: available.dataContextId }) }) }) }, attempt));
229
229
  if (isPopover) {
230
230
  return ((0, jsx_runtime_1.jsx)(popover_surface_1.PopoverSurface, { anchor: props.anchor, label: props.label, onClose: () => closeRef.current?.(), children: (0, jsx_runtime_1.jsx)(piece_height_1.PieceHeightContext.Provider, { value: "content", children: body }) }));
231
231
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@peers-app/peers-ui",
3
- "version": "0.34.5",
3
+ "version": "0.34.7",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/peers-app/peers-ui.git"
@@ -36,7 +36,7 @@
36
36
  "lint:fix": "biome check --write ."
37
37
  },
38
38
  "peerDependencies": {
39
- "@peers-app/peers-sdk": "^0.34.5",
39
+ "@peers-app/peers-sdk": "^0.34.7",
40
40
  "bootstrap": "^5.3.3",
41
41
  "react": "^18.0.0",
42
42
  "react-dom": "^18.0.0"
@@ -47,7 +47,7 @@
47
47
  "@babel/preset-react": "^7.24.1",
48
48
  "@babel/preset-typescript": "^7.27.1",
49
49
  "@biomejs/biome": "2.3.11",
50
- "@peers-app/peers-sdk": "0.34.5",
50
+ "@peers-app/peers-sdk": "0.34.7",
51
51
  "@testing-library/dom": "^10.4.0",
52
52
  "@testing-library/jest-dom": "^6.6.3",
53
53
  "@testing-library/react": "^16.3.0",
@@ -107,6 +107,7 @@
107
107
  "ml-tree-similarity": "^2.2.0",
108
108
  "moment": "^2.30.1",
109
109
  "moment-timezone": "^0.5.46",
110
+ "prismjs": "^1.30.0",
110
111
  "react-infinite-scroll-component": "^6.1.0",
111
112
  "react-markdown": "^9.0.1",
112
113
  "react-qr-code": "^2.2.0",