@acryldev/blends-frame 0.2.7 → 0.2.8

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
@@ -17720,7 +17720,7 @@ window.__ModuleLoader__.load({
17720
17720
  });
17721
17721
  if (!response.ok) return errorOf$1(response);
17722
17722
  },
17723
- async planShare(name, target) {
17723
+ async planShare(name, target, owner) {
17724
17724
  const response = await fetcher(FRAME_PLUGINS_SHARE_PLAN_PATH, {
17725
17725
  method: "POST",
17726
17726
  credentials: "same-origin",
@@ -17728,12 +17728,15 @@ window.__ModuleLoader__.load({
17728
17728
  "Content-Type": "application/json",
17729
17729
  Accept: "application/json"
17730
17730
  },
17731
- body: JSON.stringify(target === void 0 ? { name } : target === "registry" ? {
17732
- name,
17733
- registry: true
17734
- } : {
17735
- name,
17736
- visibility: target
17731
+ body: JSON.stringify({
17732
+ ...target === void 0 ? { name } : target === "registry" ? {
17733
+ name,
17734
+ registry: true
17735
+ } : {
17736
+ name,
17737
+ visibility: target
17738
+ },
17739
+ ...owner === void 0 ? {} : { owner }
17737
17740
  })
17738
17741
  });
17739
17742
  if (!response.ok) return errorOf$1(response);
@@ -17752,7 +17755,7 @@ window.__ModuleLoader__.load({
17752
17755
  if (!response.ok) return errorOf$1(response);
17753
17756
  return parseSavedPlugin(await response.json());
17754
17757
  },
17755
- async share(name, confirmed) {
17758
+ async share(name, confirmed, owner) {
17756
17759
  const response = await fetcher(FRAME_PLUGINS_SHARE_PATH, {
17757
17760
  method: "POST",
17758
17761
  credentials: "same-origin",
@@ -17762,7 +17765,8 @@ window.__ModuleLoader__.load({
17762
17765
  },
17763
17766
  body: JSON.stringify({
17764
17767
  name,
17765
- confirm: confirmed
17768
+ confirm: confirmed,
17769
+ ...owner === void 0 ? {} : { owner }
17766
17770
  })
17767
17771
  });
17768
17772
  if (!response.ok) return errorOf$1(response);
@@ -47609,6 +47613,7 @@ body[data-bf-settings-full] { --bf-pane-h: calc(100vh - 24px); }
47609
47613
  const [github, setGithub] = (0, react.useState)({ status: "checking" });
47610
47614
  const [details, setDetails] = (0, react.useState)(false);
47611
47615
  const [copied, setCopied] = (0, react.useState)(void 0);
47616
+ const [owner, setOwner] = (0, react.useState)("");
47612
47617
  (0, react.useEffect)(() => {
47613
47618
  let live = true;
47614
47619
  readGithub().then((answer) => {
@@ -47624,6 +47629,7 @@ body[data-bf-settings-full] { --bf-pane-h: calc(100vh - 24px); }
47624
47629
  };
47625
47630
  }, [readGithub]);
47626
47631
  const share = plugin.share;
47632
+ const ownerAsked = owner.trim() === "" ? void 0 : owner.trim();
47627
47633
  const blocked = github.status === "missing" || github.status === "signed-out";
47628
47634
  const idle = state.step === "choose" || state.step === "failed" || state.step === "done";
47629
47635
  const save = async () => {
@@ -47653,7 +47659,7 @@ body[data-bf-settings-full] { --bf-pane-h: calc(100vh - 24px); }
47653
47659
  try {
47654
47660
  setState({
47655
47661
  step: "confirm",
47656
- plan: await share.plan(target)
47662
+ plan: await share.plan(target, ownerAsked)
47657
47663
  });
47658
47664
  } catch (cause) {
47659
47665
  setState(failed(cause));
@@ -47666,7 +47672,7 @@ body[data-bf-settings-full] { --bf-pane-h: calc(100vh - 24px); }
47666
47672
  what: "Sharing…"
47667
47673
  });
47668
47674
  try {
47669
- const shared = await share.publish(plan);
47675
+ const shared = await share.publish(plan, ownerAsked);
47670
47676
  onShared(shared);
47671
47677
  const address = colleagueAddress(shared);
47672
47678
  setState({
@@ -47765,14 +47771,22 @@ body[data-bf-settings-full] { --bf-pane-h: calc(100vh - 24px); }
47765
47771
  children: shareDetails(state.plan).map((line) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", { children: line }, line))
47766
47772
  })
47767
47773
  ]
47768
- }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", { children: choices.map((choice) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("b", { children: choice.title }), choice.say] }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
47774
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [share !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
47775
+ className: "acrylBlendsSearch",
47776
+ "aria-label": "GitHub account or organization",
47777
+ placeholder: "GitHub account or organization (blank: yours)",
47778
+ value: owner,
47779
+ onChange: (event) => {
47780
+ setOwner(event.target.value);
47781
+ }
47782
+ }) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", { children: choices.map((choice) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("b", { children: choice.title }), choice.say] }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
47769
47783
  type: "button",
47770
47784
  disabled: choice.disabled || !idle,
47771
47785
  onClick: () => {
47772
47786
  choice.target === void 0 ? save() : ask(choice.target);
47773
47787
  },
47774
47788
  children: choice.button
47775
- })] }, choice.title)) }),
47789
+ })] }, choice.title)) })] }),
47776
47790
  state.step === "confirm" || state.step === "working" ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(GithubNote, {
47777
47791
  github,
47778
47792
  copy,
@@ -50755,8 +50769,8 @@ body[data-bf-settings-full] [data-shortcut-modal="settings"] { width: calc(100vw
50755
50769
  await appPlugins.switch(plugin.kind, plugin.name, on);
50756
50770
  canvas.reload();
50757
50771
  }, plugin.kind === "made" ? {
50758
- plan: (target) => appPlugins.planShare(plugin.name, target),
50759
- publish: (confirmed) => appPlugins.share(plugin.name, confirmed)
50772
+ plan: (target, owner) => appPlugins.planShare(plugin.name, target, owner),
50773
+ publish: (confirmed, owner) => appPlugins.share(plugin.name, confirmed, owner)
50760
50774
  } : void 0, void 0, {
50761
50775
  ...plugin.kind === "made" ? { save: () => appPlugins.save(plugin.name) } : {},
50762
50776
  ...viewSource === void 0 ? {} : { viewSource }