@flamingo-stack/openframe-frontend-core 0.0.849 → 0.0.850

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 (62) hide show
  1. package/dist/build/export-map.json +1 -1
  2. package/dist/{chunk-SHQY4GOE.cjs → chunk-2QZUTNL3.cjs} +24 -24
  3. package/dist/{chunk-TEKN6TJ5.cjs → chunk-7ICHJVAT.cjs} +6 -6
  4. package/dist/{chunk-IKOL6NJY.cjs → chunk-CAGNWDVJ.cjs} +11 -1
  5. package/dist/{chunk-ZY34R37A.cjs → chunk-GAYLAA3L.cjs} +21 -21
  6. package/dist/{chunk-Z5UCDEKZ.cjs → chunk-IPGGSFR7.cjs} +4 -4
  7. package/dist/{chunk-PV2XQJ2R.cjs → chunk-JWIITCVB.cjs} +11 -11
  8. package/dist/{chunk-YYHQY3K6.cjs → chunk-LGYPCUHO.cjs} +9 -9
  9. package/dist/{chunk-KXBZCUDW.cjs → chunk-OHHDX3Z4.cjs} +16 -16
  10. package/dist/{chunk-MC3L525K.cjs → chunk-QJER2ZNA.cjs} +3 -3
  11. package/dist/{chunk-36XWCVSM.cjs → chunk-VRWBJL7B.cjs} +34 -34
  12. package/dist/{chunk-YLETC7LP.cjs → chunk-XKOL5CNU.cjs} +267 -226
  13. package/dist/{chunk-C3P7IUTU.cjs → chunk-ZDSC3GFX.cjs} +5 -4
  14. package/dist/{cloud-tenants-HKUUEUAY.cjs → cloud-tenants-TVB3DT3J.cjs} +3 -3
  15. package/dist/components/case-studies/index.cjs +12 -12
  16. package/dist/components/contact/index.cjs +4 -4
  17. package/dist/components/docs/index.cjs +5 -5
  18. package/dist/components/embeds/embed-viewer-frame.d.ts +2 -0
  19. package/dist/components/embeds/embed-viewer-frame.d.ts.map +1 -1
  20. package/dist/components/embeds/embed-viewer-frame.js +12 -2
  21. package/dist/components/embeds/index.cjs +4 -4
  22. package/dist/components/embeds/pdf-viewer.d.ts.map +1 -1
  23. package/dist/components/embeds/pdf-viewer.js +2 -1
  24. package/dist/components/faq/index.cjs +4 -4
  25. package/dist/components/features/index.cjs +5 -3
  26. package/dist/components/features/software/index.d.ts +1 -1
  27. package/dist/components/features/software/index.d.ts.map +1 -1
  28. package/dist/components/features/software/index.js +2 -0
  29. package/dist/components/features/software/software-action-copy.d.ts.map +1 -1
  30. package/dist/components/features/software/software-action-copy.js +6 -12
  31. package/dist/components/features/software/software-action-form.d.ts +7 -1
  32. package/dist/components/features/software/software-action-form.d.ts.map +1 -1
  33. package/dist/components/features/software/software-action-form.js +11 -3
  34. package/dist/components/features/software/update-settings-fields.d.ts +12 -1
  35. package/dist/components/features/software/update-settings-fields.d.ts.map +1 -1
  36. package/dist/components/features/software/update-settings-fields.js +57 -29
  37. package/dist/components/help-center-pages/index.cjs +52 -52
  38. package/dist/components/index.cjs +20 -18
  39. package/dist/components/meeting-scheduler/index.cjs +28 -28
  40. package/dist/components/navigation/index.cjs +4 -4
  41. package/dist/components/onboarding-guides/index.cjs +4 -4
  42. package/dist/components/product-demo/index.cjs +13 -13
  43. package/dist/components/tickets/index.cjs +6 -6
  44. package/dist/components/ui/index.cjs +3 -3
  45. package/dist/components/ui/page-actions.d.ts.map +1 -1
  46. package/dist/components/ui/page-actions.js +11 -1
  47. package/dist/{devices-P7M4Z7VP.cjs → devices-NGCTSXIU.cjs} +4 -4
  48. package/dist/index.cjs +6 -4
  49. package/dist/{knowledge-TC7JLOWI.cjs → knowledge-75PO5DYS.cjs} +3 -3
  50. package/dist/{logs-GPOYCP4B.cjs → logs-PZESOAIG.cjs} +10 -10
  51. package/dist/{policies-ZUHOUMDD.cjs → policies-6XNMBFWO.cjs} +7 -7
  52. package/dist/{remote-session-NT4NG7EF.cjs → remote-session-Q2FIBCGT.cjs} +4 -4
  53. package/dist/{scripts-FOEVDGTH.cjs → scripts-B3JW6TPF.cjs} +10 -10
  54. package/dist/{software-update-XGTMNFST.cjs → software-update-NWP542J7.cjs} +7 -7
  55. package/package.json +1 -1
  56. package/src/components/embeds/embed-viewer-frame.tsx +10 -2
  57. package/src/components/embeds/pdf-viewer.tsx +4 -1
  58. package/src/components/features/software/index.ts +1 -0
  59. package/src/components/features/software/software-action-copy.ts +19 -12
  60. package/src/components/features/software/software-action-form.tsx +16 -3
  61. package/src/components/features/software/update-settings-fields.tsx +104 -32
  62. package/src/components/ui/page-actions.tsx +19 -2
@@ -1,8 +1,6 @@
1
1
  'use client';
2
2
 
3
- import { InfoCircleIcon } from '../../icons-v2-generated';
4
3
  import {
5
- Alert,
6
4
  CheckboxBlock,
7
5
  Label,
8
6
  RadioGroupBlock,
@@ -71,24 +69,95 @@ export const DEFAULT_SOFTWARE_UPDATE_SETTINGS: SoftwareUpdateSettingsValues = {
71
69
  autoUpdatePolicy: DEFAULT_SOFTWARE_UPDATE_POLICY,
72
70
  };
73
71
 
74
- const MODE_OPTIONS: RadioGroupBlockOption[] = [
75
- {
72
+ /** Force Update, with a 7-day deadline ready for when Wait is picked: what the form opens with without notifications. */
73
+ const FORCE_UPDATE_POLICY: SoftwareUpdatePolicy = {
74
+ ...DEFAULT_SOFTWARE_UPDATE_POLICY,
75
+ mode: 'FORCE',
76
+ deadlineEnabled: false,
77
+ };
78
+
79
+ /**
80
+ * What the form opens with. With user notifications, the server's own defaults. Without them, Force Update: an app is
81
+ * never closed unannounced a week later, and nobody is promised a prompt that cannot be shown.
82
+ */
83
+ export function defaultSoftwareUpdateSettings(userNotifications: boolean): SoftwareUpdateSettingsValues {
84
+ if (userNotifications) return DEFAULT_SOFTWARE_UPDATE_SETTINGS;
85
+ return { ...DEFAULT_SOFTWARE_UPDATE_SETTINGS, policy: FORCE_UPDATE_POLICY, autoUpdatePolicy: FORCE_UPDATE_POLICY };
86
+ }
87
+
88
+ /**
89
+ * The two modes and their deadline, worded by what the device does. With user notifications the user is asked and
90
+ * warned. Without them the agent shows nothing on the device (no prompt, no countdown on screen; there is no end-user
91
+ * UI anywhere yet), so the copy says only what happens:
92
+ * - Wait (WAIT, no deadline): the agent reports Waiting and installs once the app is closed.
93
+ * - A deadline (WAIT + `deadlineSeconds`): counted from the first time the agent finds the app running; at the deadline
94
+ * the backend sends the update again as FORCE (`armDeadline` / `driveDeadlineForce` in openframe-client-core), and
95
+ * withdraws that if the update finished first.
96
+ * - Force (FORCE): the agent waits `countdownSeconds` (clamped to 60–1800 s), asks the app to close, stops it after a
97
+ * 10 s grace and installs (`run.rs` / `close.rs` in openframe-client). The wait is silent, so it is not offered as a
98
+ * control; the copy states it, since the app is not closed at once.
99
+ */
100
+ interface ModeCopy {
101
+ wait: RadioGroupBlockOption;
102
+ force: RadioGroupBlockOption;
103
+ deadline: { label: string; description: string };
104
+ }
105
+
106
+ /** "5 minutes": the silent wait before a forced close, worded as the countdown options word it. */
107
+ function closeDelay(countdownSeconds: number): string {
108
+ const option = SOFTWARE_UPDATE_COUNTDOWN_OPTIONS.find(candidate => candidate.seconds === countdownSeconds);
109
+ if (option) return option.label;
110
+ const minutes = Math.max(1, Math.round(countdownSeconds / 60));
111
+ return minutes === 1 ? '1 minute' : `${minutes} minutes`;
112
+ }
113
+
114
+ const NOTIFIED_COPY: ModeCopy = {
115
+ wait: {
76
116
  value: 'WAIT',
77
117
  label: 'Wait & notify',
78
118
  description: 'The user gets Update now or Ask Later. If they close the app, it updates then.',
79
119
  },
80
- {
120
+ force: {
81
121
  value: 'FORCE',
82
122
  label: 'Force Update',
83
123
  description: 'The user gets a short countdown, then the app closes and updates.',
84
124
  },
85
- ];
125
+ deadline: {
126
+ label: 'Countdown after the deadline',
127
+ description: 'If the update still isn’t installed by the deadline, the user gets a countdown and then it installs.',
128
+ },
129
+ };
130
+
131
+ function silentCopy(countdownSeconds: number): ModeCopy {
132
+ const delay = closeDelay(countdownSeconds);
133
+ return {
134
+ wait: { value: 'WAIT', label: 'Wait', description: 'The update waits until the user closes the app.' },
135
+ force: {
136
+ value: 'FORCE',
137
+ label: 'Force Update',
138
+ description: `The app is closed without warning ${delay} later, then updated.`,
139
+ },
140
+ deadline: {
141
+ label: 'Close the app after a deadline',
142
+ description: `If the app is still open by the deadline, it is closed without warning ${delay} later, then updated.`,
143
+ },
144
+ };
145
+ }
86
146
 
87
147
  const SAME_SETTINGS_DESCRIPTION: Record<SoftwareUpdateMode, string> = {
88
148
  WAIT: 'Auto-updates follow "If the app is running" above. Uncheck to set them separately.',
89
149
  FORCE: 'Later releases will also be force-updated.',
90
150
  };
91
151
 
152
+ /**
153
+ * "Keep it auto-updated", as the backend runs it (`PackageAutoUpdatePolicyService.turnOn`, `PackageAutoUpdateTrigger`):
154
+ * a run with it on enables a policy per device for the package, and the trigger orders each new catalog version (Brew
155
+ * and winget catalogs) on those devices. A run with it off leaves an earlier policy as it is: only Turn Off Auto-Update
156
+ * (`turnOffSoftwareAutoUpdate`) or the package leaving the device turns one off, so "off" does not mean "stop".
157
+ */
158
+ const AUTO_UPDATE_DESCRIPTION =
159
+ 'After this update, OpenFrame installs each new version from Winget or Brew on the selected devices. Leaving it off does not turn off auto-update that is already on there.';
160
+
92
161
  const groupLabelClass = 'text-h5 text-ods-text-secondary';
93
162
 
94
163
  function SecondsSelect({
@@ -126,17 +195,21 @@ function UpdatePolicyFields({
126
195
  name,
127
196
  label,
128
197
  policy,
198
+ userNotifications,
129
199
  onChange,
130
200
  }: {
131
201
  /** The radio group's name: two policies on one page must not share it. */
132
202
  name: string;
133
203
  label: string;
134
204
  policy: SoftwareUpdatePolicy;
205
+ /** Off, the choices say what the device does with nobody told, and there is no countdown to set. */
206
+ userNotifications: boolean;
135
207
  onChange: (policy: SoftwareUpdatePolicy) => void;
136
208
  }) {
209
+ const copy = userNotifications ? NOTIFIED_COPY : silentCopy(policy.countdownSeconds);
137
210
  const waits = policy.mode === 'WAIT';
138
211
  const deadline = waits && policy.deadlineEnabled;
139
- const countdown = (
212
+ const countdown = userNotifications && (
140
213
  <SecondsSelect
141
214
  label="Countdown"
142
215
  value={policy.countdownSeconds}
@@ -154,7 +227,7 @@ function UpdatePolicyFields({
154
227
  variant="grouped"
155
228
  value={policy.mode}
156
229
  onValueChange={mode => onChange({ ...policy, mode: mode as SoftwareUpdateMode })}
157
- options={MODE_OPTIONS}
230
+ options={[copy.wait, copy.force]}
158
231
  itemClassName="py-[var(--spacing-system-sf)]"
159
232
  />
160
233
  </div>
@@ -164,8 +237,8 @@ function UpdatePolicyFields({
164
237
  id={`${name}-deadline`}
165
238
  checked={policy.deadlineEnabled}
166
239
  onCheckedChange={deadlineEnabled => onChange({ ...policy, deadlineEnabled })}
167
- label="Countdown after the deadline"
168
- description="If the update still isn’t installed by the deadline, the user gets a countdown and then it installs."
240
+ label={copy.deadline.label}
241
+ description={copy.deadline.description}
169
242
  />
170
243
  {deadline && (
171
244
  <div className="grid grid-cols-1 gap-[var(--spacing-system-lf)] content-md:grid-cols-3 content-md:items-start">
@@ -180,7 +253,9 @@ function UpdatePolicyFields({
180
253
  )}
181
254
  </div>
182
255
  ) : (
183
- <div className="grid grid-cols-1 gap-[var(--spacing-system-lf)] content-md:grid-cols-3">{countdown}</div>
256
+ userNotifications && (
257
+ <div className="grid grid-cols-1 gap-[var(--spacing-system-lf)] content-md:grid-cols-3">{countdown}</div>
258
+ )
184
259
  )}
185
260
  </div>
186
261
  );
@@ -189,6 +264,12 @@ function UpdatePolicyFields({
189
264
  export interface SoftwareUpdateSettingsFieldsProps {
190
265
  value: SoftwareUpdateSettingsValues;
191
266
  onChange: (value: SoftwareUpdateSettingsValues) => void;
267
+ /**
268
+ * The devices can notify the user: Wait & notify, its countdown after the deadline and the countdowns. Default false,
269
+ * as today, when the client has no notifications: Wait (until the user closes the app, or a deadline closes it without
270
+ * warning) or Force Update, and no countdown.
271
+ */
272
+ userNotifications?: boolean;
192
273
  }
193
274
 
194
275
  /**
@@ -196,7 +277,11 @@ export interface SoftwareUpdateSettingsFieldsProps {
196
277
  * rules 1034:8173): what happens on a device where the app is running, and
197
278
  * whether later releases are installed the same way.
198
279
  */
199
- export function SoftwareUpdateSettingsFields({ value, onChange }: SoftwareUpdateSettingsFieldsProps) {
280
+ export function SoftwareUpdateSettingsFields({
281
+ value,
282
+ onChange,
283
+ userNotifications = false,
284
+ }: SoftwareUpdateSettingsFieldsProps) {
200
285
  return (
201
286
  <section aria-labelledby="software-update-settings" className="flex flex-col gap-[var(--spacing-system-l)]">
202
287
  <h2 id="software-update-settings" className="pt-[var(--spacing-system-l)] text-ods-text-primary text-h2">
@@ -207,6 +292,7 @@ export function SoftwareUpdateSettingsFields({ value, onChange }: SoftwareUpdate
207
292
  name="updatePolicy"
208
293
  label="If the app is running"
209
294
  policy={value.policy}
295
+ userNotifications={userNotifications}
210
296
  onChange={policy => onChange({ ...value, policy })}
211
297
  />
212
298
 
@@ -218,7 +304,7 @@ export function SoftwareUpdateSettingsFields({ value, onChange }: SoftwareUpdate
218
304
  checked={value.autoUpdate}
219
305
  onCheckedChange={autoUpdate => onChange({ ...value, autoUpdate })}
220
306
  label="Keep it auto-updated"
221
- description="After this update, OpenFrame installs each new version from Winget or Brew on the selected devices. When off, only this update runs."
307
+ description={AUTO_UPDATE_DESCRIPTION}
222
308
  />
223
309
  {value.autoUpdate && (
224
310
  <>
@@ -235,6 +321,7 @@ export function SoftwareUpdateSettingsFields({ value, onChange }: SoftwareUpdate
235
321
  name="autoUpdatePolicy"
236
322
  label="For auto-updates"
237
323
  policy={value.autoUpdatePolicy}
324
+ userNotifications={userNotifications}
238
325
  onChange={autoUpdatePolicy => onChange({ ...value, autoUpdatePolicy })}
239
326
  />
240
327
  </div>
@@ -244,25 +331,10 @@ export function SoftwareUpdateSettingsFields({ value, onChange }: SoftwareUpdate
244
331
  </div>
245
332
  </div>
246
333
 
247
- {/* Core Alert on the card surface, as a note: it comes with "Keep it auto-updated" and goes with it, since the
248
- reinstall is what lets OpenFrame keep a hand-installed app updated, and a one-off update promises no more. The
249
- icon sits in a span so Alert's `[&>svg]` positioning does not apply. */}
250
- {value.autoUpdate && (
251
- <Alert
252
- role="note"
253
- className="flex items-center gap-[var(--spacing-system-m)] rounded-[6px] border-ods-border bg-ods-card p-[var(--spacing-system-m)]"
254
- >
255
- <span className="shrink-0 text-ods-text-secondary">
256
- <InfoCircleIcon size={24} color="currentColor" />
257
- </span>
258
- <div className="flex min-w-0 flex-1 flex-col gap-[var(--spacing-system-xxs)]">
259
- <p className="text-ods-text-primary text-h3">Apps installed by hand get reinstalled</p>
260
- <p className="text-ods-text-secondary text-h6">
261
- On the first update, OpenFrame reinstalls them with Winget or Brew so it can keep them updated.
262
- </p>
263
- </div>
264
- </Alert>
265
- )}
334
+ {/* No note that apps installed by hand get reinstalled on the first update: the agent does not do that. A copy no
335
+ package manager installed is left alone (brew probes it as not installed, winget as "not installed from a
336
+ winget source"), so it is neither updated nor reinstalled. Reinstalling it with a package manager is Adopt
337
+ (`adoptSoftware`), which the backend does not implement yet. */}
266
338
  </section>
267
339
  );
268
340
  }
@@ -527,9 +527,26 @@ function CompactPrimaryActions({ actions, loading: loadingProp }: { actions: Pag
527
527
  );
528
528
  }
529
529
 
530
+ const subscribeNothing = () => () => {};
531
+
532
+ /**
533
+ * False on the server and through hydration, true after: what lets a render use a value only the client measures and
534
+ * still hydrate into the server's markup.
535
+ */
536
+ function useHydrated(): boolean {
537
+ return React.useSyncExternalStore(
538
+ subscribeNothing,
539
+ () => true,
540
+ () => false,
541
+ );
542
+ }
543
+
530
544
  function MobileBottomActions({ actions, loading: loadingProp }: { actions: PageActionButton[]; loading?: boolean }) {
531
545
  const loading = useLoadingScope() || loadingProp;
532
- // Over the composer dock where the layout has one.
546
+ // Over the composer dock where the layout has one. `AppLayout` measures the dock after it mounts, and a page hydrates
547
+ // after the layout, so the height is often known by the bar's first client render: drawn then, it would not match the
548
+ // server's markup (no offset). The bar takes it from the render after hydration instead.
549
+ const hydrated = useHydrated();
533
550
  const dockHeight = useComposerDockHeight();
534
551
  // Its height, for the chrome that stays clear of it (`useMobileActionBarHeight`).
535
552
  const barRef = React.useRef<HTMLDivElement>(null);
@@ -543,7 +560,7 @@ function MobileBottomActions({ actions, loading: loadingProp }: { actions: PageA
543
560
  <div
544
561
  ref={barRef}
545
562
  data-testid="mobile-action-bar"
546
- style={dockHeight > 0 ? { bottom: dockHeight } : undefined}
563
+ style={hydrated && dockHeight > 0 ? { bottom: dockHeight } : undefined}
547
564
  className={cn(
548
565
  'fixed bottom-0 left-0 right-0 z-50 md:hidden',
549
566
  'border-t border-ods-border bg-ods-card',