@harborppm/cli 0.9.1 → 0.9.2

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 (2) hide show
  1. package/dist/app.mjs +28 -5
  2. package/package.json +1 -1
package/dist/app.mjs CHANGED
@@ -5490,7 +5490,7 @@ function TaskPanel({ taskId, width, height, go, onClose }) {
5490
5490
  const projects = useHarbor((s) => s.projects);
5491
5491
  const people = useHarbor((s) => s.people);
5492
5492
  const comments = useHarbor((s) => s.comments);
5493
- const viewOnly = useHarbor((s) => s.myRole === "viewer");
5493
+ const viewOnly = useHarbor((s) => s.myRole === "viewer" || s.keepPaused);
5494
5494
  const task = tasks.find((t) => t.id === taskId);
5495
5495
  const [at, setAt] = useState(0);
5496
5496
  const [editing, setEditing] = useState(null);
@@ -5932,6 +5932,7 @@ function App({ ui }) {
5932
5932
  const harborName = useHarbor((s) => s.harborName);
5933
5933
  const workspaceId = useHarbor((s) => s.workspaceId);
5934
5934
  const viewOnly = useHarbor((s) => s.myRole === "viewer");
5935
+ const paused = useHarbor((s) => s.keepPaused);
5935
5936
  const blockPending = useHarbor((s) => s.blockPending);
5936
5937
  useHarbor((s) => s.readPingIds?.length ?? 0);
5937
5938
  const save = useStore(ui, (s) => s.save);
@@ -6347,7 +6348,10 @@ function App({ ui }) {
6347
6348
  bold: true,
6348
6349
  children: harborName ?? "…"
6349
6350
  }),
6350
- viewOnly ? /* @__PURE__ */ jsx(Text, {
6351
+ paused ? /* @__PURE__ */ jsx(Text, {
6352
+ color: theme.warn,
6353
+ children: " · trial ended, view only"
6354
+ }) : viewOnly ? /* @__PURE__ */ jsx(Text, {
6351
6355
  color: theme.warn,
6352
6356
  children: " · view only"
6353
6357
  }) : null
@@ -8404,6 +8408,9 @@ function peopleSpendSlice({ set, get, write }) {
8404
8408
  * as in a browser tab. No persistence: the server holds the harbor, and
8405
8409
  * sync.ts keeps this copy in step with it.
8406
8410
  */
8411
+ /** What the store tells the screen: a refused edit, an undo that kept something. */
8412
+ /** Why nothing changed in a harbor whose free trial has ended (keep.ts). */
8413
+ const PAUSED_NOTICE = "This harbor's free trial has ended, so that wasn't changed. Its owner can subscribe at harborppm.com/keep.";
8407
8414
  /** An empty harbor: what the store holds before one loads. */
8408
8415
  function blank() {
8409
8416
  return pickData({ currentUserId: "" });
@@ -8413,13 +8420,16 @@ function createAppStore(onNotice = () => {}) {
8413
8420
  const store = createStore()((set, get) => {
8414
8421
  const guardedSet = (partial, replace) => {
8415
8422
  const s = get();
8416
- if (s.myRole !== "viewer") {
8423
+ if (!readOnlyHarbor(s)) {
8417
8424
  set(partial, replace);
8418
8425
  return;
8419
8426
  }
8420
8427
  const next = typeof partial === "function" ? partial(s) : partial;
8421
8428
  const { allowed, blocked } = viewerUpdate(s, next);
8422
- if (blocked) onNotice({ kind: "view-only" });
8429
+ if (blocked) onNotice({
8430
+ kind: "view-only",
8431
+ paused: s.keepPaused
8432
+ });
8423
8433
  set(allowed);
8424
8434
  };
8425
8435
  const write = (partial) => {
@@ -8453,6 +8463,8 @@ function createAppStore(onNotice = () => {}) {
8453
8463
  kept: false,
8454
8464
  keepInterval: null,
8455
8465
  stripeReady: false,
8466
+ keepPaused: false,
8467
+ trialEndsAt: null,
8456
8468
  wipPending: null,
8457
8469
  blockPending: null,
8458
8470
  ...sessionSlice(api),
@@ -9025,6 +9037,16 @@ function createSync(opts) {
9025
9037
  if (told) notice(told.message);
9026
9038
  if (result.conflictIds.length > 0) notice("Someone else saved changes here; pulled in the latest.");
9027
9039
  }
9040
+ } else if ("paused" in result && result.paused) {
9041
+ const now = store.getState();
9042
+ now.setKeep({
9043
+ kept: false,
9044
+ interval: now.keepInterval,
9045
+ stripe: now.stripeReady,
9046
+ trialEndsAt: now.trialEndsAt,
9047
+ paused: true
9048
+ });
9049
+ notice(PAUSED_NOTICE);
9028
9050
  } else if ("readOnly" in result && result.readOnly) {
9029
9051
  store.getState().setMyRole("viewer");
9030
9052
  notice("You can only view this harbor now, so that change wasn't saved.");
@@ -9112,6 +9134,7 @@ function createSync(opts) {
9112
9134
  s.setWorkspace(loaded.id, true);
9113
9135
  s.setWorkspaceVersion(loaded.version);
9114
9136
  s.setMyRole(normalizeRole(loaded.role));
9137
+ if (loaded.keep) s.setKeep(loaded.keep);
9115
9138
  s.setHarborName(loaded.name);
9116
9139
  s.setPhase("ready");
9117
9140
  });
@@ -9296,7 +9319,7 @@ async function startApp(deps, options = {}) {
9296
9319
  const account = plainDeep(deps.account);
9297
9320
  const harbors = plainDeep(deps.harbors);
9298
9321
  const ui = createUiStore();
9299
- const store = createAppStore((n) => ui.setState({ notice: n.kind === "view-only" ? "You can only view this harbor, so that wasn't changed." : n.kept > 0 ? `Undid ${n.label}. ${n.kept} field${n.kept === 1 ? "" : "s"} someone else changed since stayed theirs.` : `Undid ${n.label}.` }));
9322
+ const store = createAppStore((n) => ui.setState({ notice: n.kind === "view-only" ? n.paused ? PAUSED_NOTICE : "You can only view this harbor, so that wasn't changed." : n.kept > 0 ? `Undid ${n.label}. ${n.kept} field${n.kept === 1 ? "" : "s"} someone else changed since stayed theirs.` : `Undid ${n.label}.` }));
9300
9323
  const sync = createSync({
9301
9324
  store,
9302
9325
  transport,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@harborppm/cli",
3
- "version": "0.9.1",
3
+ "version": "0.9.2",
4
4
  "description": "Harbor from the terminal: a full-screen app with everything, plus commands for scripts and agents.",
5
5
  "keywords": [
6
6
  "harbor",