@acryldev/launcher-desktop 0.1.0 → 0.1.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.
package/lib/client.js CHANGED
@@ -28,6 +28,10 @@ window.__ModuleLoader__.load({
28
28
  const LAUNCHER_PUBLISH_PATH = `${LAUNCHER_API_PREFIX}/publish`;
29
29
  const LAUNCHER_SHARE_PLAN_PATH = `${LAUNCHER_API_PREFIX}/share-plan`;
30
30
  const LAUNCHER_SHARE_PATH = `${LAUNCHER_API_PREFIX}/share`;
31
+ const LAUNCHER_GITHUB_PATH = `${LAUNCHER_API_PREFIX}/github`;
32
+ const LAUNCHER_GITHUB_START_PATH = `${LAUNCHER_API_PREFIX}/github-start`;
33
+ const LAUNCHER_GITHUB_POLL_PATH = `${LAUNCHER_API_PREFIX}/github-poll`;
34
+ const LAUNCHER_GITHUB_DISCONNECT_PATH = `${LAUNCHER_API_PREFIX}/github-disconnect`;
31
35
  const SURFACES = [
32
36
  "web",
33
37
  "desktop",
@@ -98,6 +102,10 @@ window.__ModuleLoader__.load({
98
102
  publishPlan: (request) => send(LAUNCHER_PUBLISH_PLAN_PATH, request),
99
103
  publish: (request) => send(LAUNCHER_PUBLISH_PATH, request),
100
104
  sharePlan: (request) => send(LAUNCHER_SHARE_PLAN_PATH, request),
105
+ github: () => send(LAUNCHER_GITHUB_PATH, {}),
106
+ githubStart: () => send(LAUNCHER_GITHUB_START_PATH, {}),
107
+ githubPoll: () => send(LAUNCHER_GITHUB_POLL_PATH, {}),
108
+ githubDisconnect: () => send(LAUNCHER_GITHUB_DISCONNECT_PATH, {}),
101
109
  share: (request) => send(LAUNCHER_SHARE_PATH, request)
102
110
  };
103
111
  }
@@ -854,11 +862,13 @@ window.__ModuleLoader__.load({
854
862
  app,
855
863
  onClose: () => {
856
864
  setSharing(false);
857
- }
865
+ },
866
+ openExternal
858
867
  }, app.id) : null,
859
868
  running ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PluginsPanel, {
860
869
  api,
861
- app
870
+ app,
871
+ openExternal
862
872
  }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
863
873
  className: "acrylHomeNote",
864
874
  children: "Start the app to pull plugins into it and share the ones made in it."
@@ -877,8 +887,139 @@ window.__ModuleLoader__.load({
877
887
  }
878
888
  /** Where a remote lives on the web, for a person to read: `https://github.com/me/shop.git` is `github.com/me/shop`. */
879
889
  const remoteLabel = (remote) => remote.replace(/^https?:\/\//u, "").replace(/\.git$/u, "");
890
+ /**
891
+ * The GitHub connection sharing and publishing need: GitHub's device sign-in (a code the person types at github.com/login/device), so no terminal
892
+ * login is asked of anyone. Connected, it says who; apps started from then on get the connection.
893
+ */
894
+ function GithubConnect({ api, openExternal }) {
895
+ const [github, setGithub] = (0, react.useState)(void 0);
896
+ const [code, setCode] = (0, react.useState)(void 0);
897
+ const [note, setNote] = (0, react.useState)(void 0);
898
+ const box = (0, react.useRef)(null);
899
+ (0, react.useEffect)(() => {
900
+ api.github().then(setGithub, (cause) => {
901
+ setNote(message(cause));
902
+ });
903
+ }, [api]);
904
+ (0, react.useEffect)(() => {
905
+ if (code !== void 0) box.current?.scrollIntoView?.({
906
+ block: "center",
907
+ behavior: "smooth"
908
+ });
909
+ }, [code]);
910
+ (0, react.useEffect)(() => {
911
+ if (code === void 0) return void 0;
912
+ let stop = false;
913
+ let wait = code.interval;
914
+ const tick = () => {
915
+ if (stop) return;
916
+ api.githubPoll().then((answer) => {
917
+ if (stop) return;
918
+ if (answer.state === "connected") {
919
+ setCode(void 0);
920
+ setGithub({
921
+ available: true,
922
+ login: answer.login
923
+ });
924
+ return;
925
+ }
926
+ if (answer.state === "failed") {
927
+ setCode(void 0);
928
+ setNote(answer.reason);
929
+ return;
930
+ }
931
+ if (answer.interval !== void 0) wait = answer.interval;
932
+ timer = setTimeout(tick, wait * 1e3);
933
+ }, () => {
934
+ if (!stop) timer = setTimeout(tick, wait * 1e3);
935
+ });
936
+ };
937
+ let timer = setTimeout(tick, wait * 1e3);
938
+ return () => {
939
+ stop = true;
940
+ clearTimeout(timer);
941
+ };
942
+ }, [api, code]);
943
+ if (github === void 0 || !github.available) return note === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
944
+ className: "acrylHomeNote",
945
+ "data-error": true,
946
+ role: "alert",
947
+ children: note
948
+ });
949
+ if (github.login !== null) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
950
+ className: "acrylHomeNote",
951
+ role: "status",
952
+ children: [
953
+ "GitHub: signed in as ",
954
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
955
+ className: "acrylHomeMeta",
956
+ children: github.login === "" ? "your account" : github.login
957
+ }),
958
+ ".",
959
+ " ",
960
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
961
+ type: "button",
962
+ className: "acrylHomeBtn",
963
+ "data-small": true,
964
+ onClick: () => {
965
+ api.githubDisconnect().then(setGithub);
966
+ },
967
+ children: "Disconnect"
968
+ })
969
+ ]
970
+ });
971
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
972
+ className: "acrylHomeNote",
973
+ role: "group",
974
+ "aria-label": "Connect GitHub",
975
+ ref: box,
976
+ children: [code === void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { children: "Sharing sends the app to your own GitHub account. Connect it once on this computer." }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
977
+ type: "button",
978
+ className: "acrylHomeBtn",
979
+ "data-primary": true,
980
+ onClick: () => {
981
+ setNote(void 0);
982
+ api.githubStart().then((started) => {
983
+ setCode(started);
984
+ openExternal(started.verificationUri);
985
+ }, (cause) => {
986
+ setNote(message(cause));
987
+ });
988
+ },
989
+ children: "Connect GitHub"
990
+ })] }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
991
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { children: "On the GitHub page that just opened, enter this code and approve ACRYL Control Center:" }),
992
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
993
+ className: "acrylHomeName",
994
+ "aria-label": "GitHub code",
995
+ style: {
996
+ fontSize: "1.6em",
997
+ letterSpacing: "0.12em"
998
+ },
999
+ children: code.userCode
1000
+ }),
1001
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", { children: [
1002
+ "The page did not open? Go to ",
1003
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
1004
+ href: code.verificationUri,
1005
+ onClick: (event) => {
1006
+ event.preventDefault();
1007
+ openExternal(code.verificationUri);
1008
+ },
1009
+ children: code.verificationUri
1010
+ }),
1011
+ ". Waiting for your approval..."
1012
+ ] })
1013
+ ] }), note === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
1014
+ className: "acrylHomeNote",
1015
+ "data-error": true,
1016
+ role: "alert",
1017
+ children: note
1018
+ })]
1019
+ });
1020
+ }
880
1021
  /** Share a whole app: the app's own plan (which repository, how visible, what is saved first), then the person's yes. The app need not be running. */
881
- function SharePanel({ api, app, onClose }) {
1022
+ function SharePanel({ api, app, onClose, openExternal }) {
882
1023
  const [owner, setOwner] = (0, react.useState)("");
883
1024
  const [plan, setPlan] = (0, react.useState)(void 0);
884
1025
  const [done, setDone] = (0, react.useState)(void 0);
@@ -895,11 +1036,20 @@ window.__ModuleLoader__.load({
895
1036
  setBusy(false);
896
1037
  }
897
1038
  };
1039
+ const [visibility, setVisibility] = (0, react.useState)("private");
1040
+ const panel = (0, react.useRef)(null);
1041
+ (0, react.useEffect)(() => {
1042
+ panel.current?.scrollIntoView?.({
1043
+ block: "nearest",
1044
+ behavior: "smooth"
1045
+ });
1046
+ }, []);
898
1047
  const owner_ = owner.trim() === "" ? {} : { owner: owner.trim() };
899
1048
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
900
1049
  className: "acrylHomePanel",
901
1050
  role: "group",
902
1051
  "aria-label": `Share ${app.name}`,
1052
+ ref: panel,
903
1053
  children: [
904
1054
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
905
1055
  className: "acrylHomePanelTop",
@@ -911,6 +1061,10 @@ window.__ModuleLoader__.load({
911
1061
  children: "Close"
912
1062
  })]
913
1063
  }),
1064
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(GithubConnect, {
1065
+ api,
1066
+ openExternal
1067
+ }),
914
1068
  done !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
915
1069
  className: "acrylHomeNote",
916
1070
  role: "status",
@@ -934,26 +1088,45 @@ window.__ModuleLoader__.load({
934
1088
  run(async () => {
935
1089
  setPlan(await api.sharePlan({
936
1090
  id: app.id,
937
- ...owner_
1091
+ ...owner_,
1092
+ visibility
938
1093
  }));
939
1094
  });
940
1095
  },
941
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
942
- className: "acrylHomeInput",
943
- style: { flex: "1 1 240px" },
944
- value: owner,
945
- placeholder: "GitHub account (blank: yours)",
946
- "aria-label": "GitHub account",
947
- onChange: (event) => {
948
- setOwner(event.target.value);
949
- }
950
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
951
- type: "submit",
952
- className: "acrylHomeBtn",
953
- "data-primary": true,
954
- disabled: busy,
955
- children: "Review what would be sent"
956
- })]
1096
+ children: [
1097
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
1098
+ className: "acrylHomeInput",
1099
+ style: { flex: "1 1 240px" },
1100
+ value: owner,
1101
+ placeholder: "GitHub account (blank: yours)",
1102
+ "aria-label": "GitHub account",
1103
+ onChange: (event) => {
1104
+ setOwner(event.target.value);
1105
+ }
1106
+ }),
1107
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
1108
+ className: "acrylHomeInput",
1109
+ value: visibility,
1110
+ "aria-label": "Who can see it",
1111
+ onChange: (event) => {
1112
+ setVisibility(event.target.value === "public" ? "public" : "private");
1113
+ },
1114
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
1115
+ value: "private",
1116
+ children: "Private: only you and people you invite"
1117
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
1118
+ value: "public",
1119
+ children: "Public: anyone, listed as Community"
1120
+ })]
1121
+ }),
1122
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
1123
+ type: "submit",
1124
+ className: "acrylHomeBtn",
1125
+ "data-primary": true,
1126
+ disabled: busy,
1127
+ children: "Review what would be sent"
1128
+ })
1129
+ ]
957
1130
  }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
958
1131
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("dl", {
959
1132
  className: "acrylHomeKv",
@@ -1008,7 +1181,7 @@ window.__ModuleLoader__.load({
1008
1181
  });
1009
1182
  }
1010
1183
  /** The plugins of a running app: what it has, pulling one from a registry, and sharing one made here (the app's plan, then the person's yes). */
1011
- function PluginsPanel({ api, app }) {
1184
+ function PluginsPanel({ api, app, openExternal }) {
1012
1185
  const [plugins, setPlugins] = (0, react.useState)(void 0);
1013
1186
  const [source, setSource] = (0, react.useState)("");
1014
1187
  const [sharing, setSharing] = (0, react.useState)(void 0);
@@ -1144,122 +1317,129 @@ window.__ModuleLoader__.load({
1144
1317
  className: "acrylHomePanel",
1145
1318
  role: "group",
1146
1319
  "aria-label": `Share ${sharing}`,
1147
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1148
- className: "acrylHomePanelTop",
1149
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("h3", { children: ["Share ", sharing] }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
1150
- type: "button",
1151
- className: "acrylHomeBtn",
1152
- "data-small": true,
1153
- onClick: () => {
1154
- setSharing(void 0);
1155
- setPlan(void 0);
1156
- setDone(void 0);
1157
- },
1158
- children: "Close"
1159
- })]
1160
- }), done !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
1161
- className: "acrylHomeNote",
1162
- children: ["Published: ", /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1163
- className: "acrylHomeMeta",
1164
- children: done.releaseUrl
1165
- })]
1166
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
1167
- className: "acrylHomeNote",
1168
- children: ["A friend gets exactly these bytes with ", /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1169
- className: "acrylHomeMeta",
1170
- children: done.pullLine
1171
- })]
1172
- })] }) : plan === void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("form", {
1173
- className: "acrylHomeRow",
1174
- onSubmit: (event) => {
1175
- event.preventDefault();
1176
- run(`Reading what publishing ${sharing} would send...`, async () => {
1177
- setPlan(await api.publishPlan({
1178
- id: app.id,
1179
- plugin: sharing,
1180
- ...owner_
1181
- }));
1182
- });
1183
- },
1184
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
1185
- className: "acrylHomeInput",
1186
- style: { flex: "1 1 240px" },
1187
- value: owner,
1188
- placeholder: "GitHub account (blank: yours)",
1189
- "aria-label": "GitHub account",
1190
- onChange: (event) => {
1191
- setOwner(event.target.value);
1192
- }
1193
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
1194
- type: "submit",
1195
- className: "acrylHomeBtn",
1196
- "data-primary": true,
1197
- disabled: busy,
1198
- children: "Review what would be sent"
1199
- })]
1200
- }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
1201
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("dl", {
1202
- className: "acrylHomeKv",
1203
- children: [
1204
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dt", { children: "Repository" }),
1205
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("dd", { children: [
1206
- plan.owner,
1207
- "/",
1208
- plan.repo,
1209
- plan.createsRepository ? " (a new repository)" : ""
1210
- ] }),
1211
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dt", { children: "Version" }),
1212
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("dd", { children: [
1213
- plan.version,
1214
- " · ",
1215
- plan.visibility,
1216
- " · ",
1217
- plan.license
1218
- ] }),
1219
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dt", { children: "Files" }),
1220
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dd", { children: plan.files.join(", ") }),
1221
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dt", { children: "A friend pulls it with" }),
1222
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dd", { children: plan.pullLine })
1223
- ]
1224
- }),
1225
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
1226
- className: "acrylHomeNote",
1227
- children: "Nothing has been sent. It is sent only when you say yes."
1228
- }),
1320
+ children: [
1229
1321
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1230
- className: "acrylHomeActs",
1231
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
1322
+ className: "acrylHomePanelTop",
1323
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("h3", { children: ["Share ", sharing] }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
1232
1324
  type: "button",
1233
1325
  className: "acrylHomeBtn",
1234
- "data-primary": true,
1235
- disabled: busy,
1326
+ "data-small": true,
1236
1327
  onClick: () => {
1237
- run(`Publishing ${plan.owner}/${plan.repo} ${plan.version}: ${plan.createsRepository ? "making the repository, " : ""}pushing the files and making the release...`, async () => {
1238
- setDone(await api.publish({
1239
- id: app.id,
1240
- plugin: sharing,
1241
- ...owner_,
1242
- plan
1243
- }));
1244
- });
1328
+ setSharing(void 0);
1329
+ setPlan(void 0);
1330
+ setDone(void 0);
1245
1331
  },
1246
- children: [
1247
- "Yes, publish ",
1248
- plan.owner,
1249
- "/",
1250
- plan.repo
1251
- ]
1332
+ children: "Close"
1333
+ })]
1334
+ }),
1335
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(GithubConnect, {
1336
+ api,
1337
+ openExternal
1338
+ }),
1339
+ done !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
1340
+ className: "acrylHomeNote",
1341
+ children: ["Published: ", /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1342
+ className: "acrylHomeMeta",
1343
+ children: done.releaseUrl
1344
+ })]
1345
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
1346
+ className: "acrylHomeNote",
1347
+ children: ["A friend gets exactly these bytes with ", /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1348
+ className: "acrylHomeMeta",
1349
+ children: done.pullLine
1350
+ })]
1351
+ })] }) : plan === void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("form", {
1352
+ className: "acrylHomeRow",
1353
+ onSubmit: (event) => {
1354
+ event.preventDefault();
1355
+ run(`Reading what publishing ${sharing} would send...`, async () => {
1356
+ setPlan(await api.publishPlan({
1357
+ id: app.id,
1358
+ plugin: sharing,
1359
+ ...owner_
1360
+ }));
1361
+ });
1362
+ },
1363
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
1364
+ className: "acrylHomeInput",
1365
+ style: { flex: "1 1 240px" },
1366
+ value: owner,
1367
+ placeholder: "GitHub account (blank: yours)",
1368
+ "aria-label": "GitHub account",
1369
+ onChange: (event) => {
1370
+ setOwner(event.target.value);
1371
+ }
1252
1372
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
1253
- type: "button",
1373
+ type: "submit",
1254
1374
  className: "acrylHomeBtn",
1375
+ "data-primary": true,
1255
1376
  disabled: busy,
1256
- onClick: () => {
1257
- setPlan(void 0);
1258
- },
1259
- children: "Not yet"
1377
+ children: "Review what would be sent"
1260
1378
  })]
1261
- })
1262
- ] })]
1379
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
1380
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("dl", {
1381
+ className: "acrylHomeKv",
1382
+ children: [
1383
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dt", { children: "Repository" }),
1384
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("dd", { children: [
1385
+ plan.owner,
1386
+ "/",
1387
+ plan.repo,
1388
+ plan.createsRepository ? " (a new repository)" : ""
1389
+ ] }),
1390
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dt", { children: "Version" }),
1391
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("dd", { children: [
1392
+ plan.version,
1393
+ " · ",
1394
+ plan.visibility,
1395
+ " · ",
1396
+ plan.license
1397
+ ] }),
1398
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dt", { children: "Files" }),
1399
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dd", { children: plan.files.join(", ") }),
1400
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dt", { children: "A friend pulls it with" }),
1401
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dd", { children: plan.pullLine })
1402
+ ]
1403
+ }),
1404
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
1405
+ className: "acrylHomeNote",
1406
+ children: "Nothing has been sent. It is sent only when you say yes."
1407
+ }),
1408
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1409
+ className: "acrylHomeActs",
1410
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
1411
+ type: "button",
1412
+ className: "acrylHomeBtn",
1413
+ "data-primary": true,
1414
+ disabled: busy,
1415
+ onClick: () => {
1416
+ run(`Publishing ${plan.owner}/${plan.repo} ${plan.version}: ${plan.createsRepository ? "making the repository, " : ""}pushing the files and making the release...`, async () => {
1417
+ setDone(await api.publish({
1418
+ id: app.id,
1419
+ plugin: sharing,
1420
+ ...owner_,
1421
+ plan
1422
+ }));
1423
+ });
1424
+ },
1425
+ children: [
1426
+ "Yes, publish ",
1427
+ plan.owner,
1428
+ "/",
1429
+ plan.repo
1430
+ ]
1431
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
1432
+ type: "button",
1433
+ className: "acrylHomeBtn",
1434
+ disabled: busy,
1435
+ onClick: () => {
1436
+ setPlan(void 0);
1437
+ },
1438
+ children: "Not yet"
1439
+ })]
1440
+ })
1441
+ ] })
1442
+ ]
1263
1443
  }),
1264
1444
  doing === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
1265
1445
  className: "acrylHomeNote",
@@ -1281,7 +1461,7 @@ window.__ModuleLoader__.load({
1281
1461
  const [starter, setStarter] = (0, react.useState)(state.starters[0]?.value ?? "blank");
1282
1462
  const [surface, setSurface] = (0, react.useState)("web");
1283
1463
  const [busy, setBusy] = (0, react.useState)(false);
1284
- const line = `cd ${where} && acryl new ${name === "" ? "<name>" : name} ${blend === void 0 ? starter : `--from ${blend.id}`}`;
1464
+ const line = `cd ${where} && acryl new ${name === "" ? "<name>" : name} ${blend === void 0 ? starter : `--from ${blend.source ?? blend.id}`}`;
1285
1465
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("form", {
1286
1466
  className: "acrylHomePanel acrylHomeForm",
1287
1467
  onSubmit: (event) => {
@@ -1291,7 +1471,7 @@ window.__ModuleLoader__.load({
1291
1471
  where,
1292
1472
  name,
1293
1473
  surface,
1294
- ...blend === void 0 ? { starter } : { blend: blend.id }
1474
+ ...blend === void 0 ? { starter } : { blend: blend.source ?? blend.id }
1295
1475
  }).finally(() => {
1296
1476
  setBusy(false);
1297
1477
  });
@@ -1326,6 +1506,16 @@ window.__ModuleLoader__.load({
1326
1506
  "aria-label": "Name"
1327
1507
  })]
1328
1508
  }),
1509
+ blend !== void 0 && blend.origin === "community" ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
1510
+ className: "acrylHomeNote",
1511
+ "data-warn": true,
1512
+ role: "note",
1513
+ children: [
1514
+ "A Community Blend: released by someone outside the ACRYL project, from ",
1515
+ blend.source,
1516
+ ". Its code is not reviewed; make it only if you trust who released it."
1517
+ ]
1518
+ }) : null,
1329
1519
  blend !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
1330
1520
  className: "acrylHomeNote",
1331
1521
  children: blend.description