@charisol/plexo-sdk 2.0.13 → 2.0.14
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/dist/v2/components/design/useStrataSync.d.ts +5 -0
- package/dist/v2.js +132 -108
- package/package.json +1 -1
|
@@ -20,6 +20,11 @@ export interface StrataSync {
|
|
|
20
20
|
busy: string | null;
|
|
21
21
|
error: string | null;
|
|
22
22
|
notice: string | null;
|
|
23
|
+
/** What Strata said about the last send (things it accepted but would like tidied), in its own words. */
|
|
24
|
+
warnings: Array<{
|
|
25
|
+
key?: string;
|
|
26
|
+
message: string;
|
|
27
|
+
}>;
|
|
23
28
|
connect(options?: {
|
|
24
29
|
switchAccount?: boolean;
|
|
25
30
|
}): Promise<void>;
|
package/dist/v2.js
CHANGED
|
@@ -4872,8 +4872,8 @@ var go = ({ className: e = "", ...t }) => /* @__PURE__ */ K("button", {
|
|
|
4872
4872
|
className: `h-8 px-3 rounded-lg border border-px-line2 hover:border-px-accent/60 text-px-text text-[11px] font-medium cursor-pointer transition-colors disabled:opacity-50 disabled:cursor-default ${e}`
|
|
4873
4873
|
}), vo = (e) => e instanceof Ti || e instanceof Error ? e.message : "Something went wrong talking to Strata. Please try again.";
|
|
4874
4874
|
function yo() {
|
|
4875
|
-
let { strata: e } = Sa(), { designSystem: t, setDesignSystem: n, getDesignSystem: r } = Y(), [i, a] = W("unknown"), [o, s] = W(), [c, l] = W(null), [u, d] = W(null), [f, p] = W(null), [m, h] = W(null), [g, _] = W(null), v = U(null),
|
|
4876
|
-
p(e), h(null);
|
|
4875
|
+
let { strata: e } = Sa(), { designSystem: t, setDesignSystem: n, getDesignSystem: r } = Y(), [i, a] = W("unknown"), [o, s] = W(), [c, l] = W(null), [u, d] = W(null), [f, p] = W(null), [m, h] = W(null), [g, _] = W(null), [v, y] = W([]), b = U(null), x = t.strata, S = B(async (e, t) => {
|
|
4876
|
+
p(e), h(null), y([]);
|
|
4877
4877
|
try {
|
|
4878
4878
|
return await t();
|
|
4879
4879
|
} catch (e) {
|
|
@@ -4882,72 +4882,72 @@ function yo() {
|
|
|
4882
4882
|
} finally {
|
|
4883
4883
|
p(null);
|
|
4884
4884
|
}
|
|
4885
|
-
}, []),
|
|
4885
|
+
}, []), C = B((e) => {
|
|
4886
4886
|
s(e.user), a(e.connected ? "connected" : e.expired ? "expired" : "disconnected");
|
|
4887
|
-
}, []),
|
|
4887
|
+
}, []), w = B(async () => {
|
|
4888
4888
|
let t = r().strata?.projectId;
|
|
4889
|
-
!e || !t || await
|
|
4889
|
+
!e || !t || await S("Checking Strata…", async () => {
|
|
4890
4890
|
let n = await e.pull(t);
|
|
4891
|
-
|
|
4891
|
+
b.current = n, d(Ei(r(), n));
|
|
4892
4892
|
});
|
|
4893
4893
|
}, [
|
|
4894
4894
|
e,
|
|
4895
4895
|
r,
|
|
4896
|
-
|
|
4896
|
+
S
|
|
4897
4897
|
]);
|
|
4898
4898
|
V(() => {
|
|
4899
4899
|
if (!e) return;
|
|
4900
4900
|
let t = !1;
|
|
4901
4901
|
return e.status().then((e) => {
|
|
4902
|
-
t || (
|
|
4902
|
+
t || (C(e), e.connected && r().strata?.projectId && w());
|
|
4903
4903
|
}).catch(() => !t && a("disconnected")), () => {
|
|
4904
4904
|
t = !0;
|
|
4905
4905
|
};
|
|
4906
4906
|
}, [e]), V(() => {
|
|
4907
|
-
|
|
4908
|
-
}, [t,
|
|
4909
|
-
let
|
|
4907
|
+
b.current && x?.projectId && d(Ei(t, b.current));
|
|
4908
|
+
}, [t, x?.projectId]);
|
|
4909
|
+
let T = B(async (t) => {
|
|
4910
4910
|
if (!e) return;
|
|
4911
|
-
let i = o?.email?.toLowerCase(), a = await
|
|
4911
|
+
let i = o?.email?.toLowerCase(), a = await S("Connecting to Strata…", () => e.connect(t));
|
|
4912
4912
|
if (a) {
|
|
4913
|
-
if (
|
|
4913
|
+
if (C(a), t?.switchAccount && a.connected && a.user?.email?.toLowerCase() !== i) {
|
|
4914
4914
|
n((e) => {
|
|
4915
4915
|
let { strata: t, ...n } = e;
|
|
4916
4916
|
return n;
|
|
4917
|
-
}), l(null), d(null),
|
|
4917
|
+
}), l(null), d(null), b.current = null, _(`Now using ${a.user?.email ?? "your other Strata account"}.`);
|
|
4918
4918
|
return;
|
|
4919
4919
|
}
|
|
4920
|
-
a.connected && r().strata?.projectId && await
|
|
4920
|
+
a.connected && r().strata?.projectId && await w();
|
|
4921
4921
|
}
|
|
4922
4922
|
}, [
|
|
4923
4923
|
e,
|
|
4924
|
-
|
|
4925
|
-
|
|
4924
|
+
C,
|
|
4925
|
+
w,
|
|
4926
4926
|
r,
|
|
4927
|
-
|
|
4927
|
+
S,
|
|
4928
4928
|
n,
|
|
4929
4929
|
o?.email
|
|
4930
|
-
]),
|
|
4931
|
-
e && (await
|
|
4932
|
-
}, [e,
|
|
4930
|
+
]), E = B(async () => {
|
|
4931
|
+
e && (await S("Disconnecting…", () => e.disconnect()), a("disconnected"), l(null), d(null), b.current = null);
|
|
4932
|
+
}, [e, S]), D = B(async () => {
|
|
4933
4933
|
if (!e) return;
|
|
4934
|
-
let t = await
|
|
4934
|
+
let t = await S("Loading your Strata projects…", () => e.listProjects());
|
|
4935
4935
|
t && l(t);
|
|
4936
|
-
}, [e,
|
|
4936
|
+
}, [e, S]), O = B(async (e) => {
|
|
4937
4937
|
n((t) => ({
|
|
4938
4938
|
...t,
|
|
4939
4939
|
strata: {
|
|
4940
4940
|
projectId: e.id,
|
|
4941
4941
|
projectName: e.name
|
|
4942
4942
|
}
|
|
4943
|
-
})),
|
|
4944
|
-
}, [
|
|
4943
|
+
})), b.current = null, d(null), _(null), await new Promise((e) => setTimeout(e, 0)), await w();
|
|
4944
|
+
}, [w, n]), k = B(() => {
|
|
4945
4945
|
n((e) => {
|
|
4946
4946
|
let { strata: t, ...n } = e;
|
|
4947
4947
|
return n;
|
|
4948
|
-
}),
|
|
4949
|
-
}, [n]),
|
|
4950
|
-
let t =
|
|
4948
|
+
}), b.current = null, d(null), _(null);
|
|
4949
|
+
}, [n]), A = B(async (e = {}) => {
|
|
4950
|
+
let t = b.current, i = r();
|
|
4951
4951
|
if (!t || !u || !i.strata) return;
|
|
4952
4952
|
let a = wi(i, t, u, "pull", e);
|
|
4953
4953
|
n(a.designSystem), _("Brought in the latest from Strata.");
|
|
@@ -4955,27 +4955,27 @@ function yo() {
|
|
|
4955
4955
|
r,
|
|
4956
4956
|
u,
|
|
4957
4957
|
n
|
|
4958
|
-
]),
|
|
4958
|
+
]), j = B(async (t = {}) => {
|
|
4959
4959
|
let i = r().strata?.projectId;
|
|
4960
|
-
!e || !i || await
|
|
4960
|
+
!e || !i || await S("Sending to Strata…", async () => {
|
|
4961
4961
|
let a = await e.pull(i), o = r(), s = Ei(o, a), c = wi(o, a, s, "push", t);
|
|
4962
4962
|
if (!c.hasOutgoing) {
|
|
4963
|
-
|
|
4963
|
+
b.current = a, d(s), _(Si(s).conflicts ? "Some changes need a decision before they can be sent." : "Strata already has everything.");
|
|
4964
4964
|
return;
|
|
4965
4965
|
}
|
|
4966
4966
|
let l = await e.push(i, c.push, a.revision);
|
|
4967
|
-
n(c.designSystem),
|
|
4967
|
+
n(c.designSystem), b.current = null, y(l.warnings ?? []);
|
|
4968
4968
|
let u = l.warnings?.length ? ` Strata mentioned ${l.warnings.length} thing${l.warnings.length === 1 ? "" : "s"} to tidy up.` : "";
|
|
4969
4969
|
_(`Sent ${c.push.variables.length + c.push.components.length + (c.push.deleteVariables?.length ?? 0)} change${c.push.variables.length + c.push.components.length + (c.push.deleteVariables?.length ?? 0) === 1 ? "" : "s"} to Strata.${u}`);
|
|
4970
4970
|
let f = await e.pull(i);
|
|
4971
|
-
|
|
4971
|
+
b.current = f, d(Ei(c.designSystem, f));
|
|
4972
4972
|
});
|
|
4973
4973
|
}, [
|
|
4974
4974
|
e,
|
|
4975
4975
|
r,
|
|
4976
|
-
|
|
4976
|
+
S,
|
|
4977
4977
|
n
|
|
4978
|
-
]), [
|
|
4978
|
+
]), [M, N] = W(), ee = x?.projectId, te = B((t) => {
|
|
4979
4979
|
let r = (e) => n((t) => t.strata ? {
|
|
4980
4980
|
...t,
|
|
4981
4981
|
strata: {
|
|
@@ -4983,32 +4983,32 @@ function yo() {
|
|
|
4983
4983
|
autoUpdate: e
|
|
4984
4984
|
}
|
|
4985
4985
|
} : t);
|
|
4986
|
-
r(t), !(!e?.setAutoUpdate || !
|
|
4986
|
+
r(t), !(!e?.setAutoUpdate || !ee) && e.setAutoUpdate(ee, t).then(() => N(void 0), (e) => {
|
|
4987
4987
|
r(!t), h(`Couldn't ${t ? "turn on" : "turn off"} automatic updates. ${vo(e)}`);
|
|
4988
4988
|
});
|
|
4989
4989
|
}, [
|
|
4990
4990
|
e,
|
|
4991
|
-
|
|
4991
|
+
ee,
|
|
4992
4992
|
n
|
|
4993
4993
|
]);
|
|
4994
4994
|
V(() => {
|
|
4995
|
-
if (!e?.autoUpdateStatus || !
|
|
4996
|
-
|
|
4995
|
+
if (!e?.autoUpdateStatus || !x?.autoUpdate) {
|
|
4996
|
+
N(void 0);
|
|
4997
4997
|
return;
|
|
4998
4998
|
}
|
|
4999
4999
|
let t = !1;
|
|
5000
5000
|
return e.autoUpdateStatus().then((e) => {
|
|
5001
|
-
t ||
|
|
5001
|
+
t || N(e.message ? {
|
|
5002
5002
|
ok: e.ok,
|
|
5003
5003
|
message: e.message
|
|
5004
5004
|
} : void 0);
|
|
5005
5005
|
}, () => {}), () => {
|
|
5006
5006
|
t = !0;
|
|
5007
5007
|
};
|
|
5008
|
-
}, [e,
|
|
5009
|
-
let
|
|
5008
|
+
}, [e, x?.autoUpdate]);
|
|
5009
|
+
let ne = B(async (t) => {
|
|
5010
5010
|
if (!e) return;
|
|
5011
|
-
let i = await
|
|
5011
|
+
let i = await S("Creating your Strata project…", () => e.createProject({
|
|
5012
5012
|
...t,
|
|
5013
5013
|
brandPrimary: t.template === "base" ? r().tokens.find((e) => e.key === "--color-brand-primary-500")?.value : void 0
|
|
5014
5014
|
}));
|
|
@@ -5021,25 +5021,25 @@ function yo() {
|
|
|
5021
5021
|
}
|
|
5022
5022
|
})), await new Promise((e) => setTimeout(e, 0));
|
|
5023
5023
|
let a = i.id;
|
|
5024
|
-
await
|
|
5024
|
+
await S("Sending your brand to Strata…", async () => {
|
|
5025
5025
|
let t = await e.pull(a), o = r(), s = Ei(o, t), c = wi(o, t, s, "both", Object.fromEntries([...s.tokens.conflicts.map((e) => [e.key, "plexo"]), ...s.components.conflicts.map((e) => [e.id, "plexo"])]));
|
|
5026
5026
|
c.hasOutgoing && await e.push(a, c.push, t.revision), n(c.designSystem);
|
|
5027
5027
|
let l = await e.pull(a);
|
|
5028
|
-
|
|
5028
|
+
b.current = l, d(Ei(c.designSystem, l)), _(`Created “${i.name}” in Strata and sent your brand to it.`);
|
|
5029
5029
|
});
|
|
5030
5030
|
}, [
|
|
5031
5031
|
e,
|
|
5032
5032
|
r,
|
|
5033
|
-
|
|
5033
|
+
S,
|
|
5034
5034
|
n
|
|
5035
5035
|
]);
|
|
5036
5036
|
return {
|
|
5037
5037
|
available: !!e,
|
|
5038
5038
|
phase: i,
|
|
5039
5039
|
user: o,
|
|
5040
|
-
project:
|
|
5041
|
-
id:
|
|
5042
|
-
name:
|
|
5040
|
+
project: x ? {
|
|
5041
|
+
id: x.projectId,
|
|
5042
|
+
name: x.projectName
|
|
5043
5043
|
} : void 0,
|
|
5044
5044
|
projects: c,
|
|
5045
5045
|
plan: u,
|
|
@@ -5051,20 +5051,21 @@ function yo() {
|
|
|
5051
5051
|
busy: f,
|
|
5052
5052
|
error: m,
|
|
5053
5053
|
notice: g,
|
|
5054
|
-
autoUpdate: !!
|
|
5055
|
-
setAutoUpdate:
|
|
5056
|
-
autoUpdateNote:
|
|
5057
|
-
|
|
5058
|
-
|
|
5059
|
-
|
|
5060
|
-
|
|
5061
|
-
|
|
5062
|
-
|
|
5063
|
-
|
|
5064
|
-
|
|
5065
|
-
|
|
5054
|
+
autoUpdate: !!x?.autoUpdate,
|
|
5055
|
+
setAutoUpdate: te,
|
|
5056
|
+
autoUpdateNote: M,
|
|
5057
|
+
warnings: v,
|
|
5058
|
+
connect: T,
|
|
5059
|
+
disconnect: E,
|
|
5060
|
+
loadProjects: D,
|
|
5061
|
+
link: O,
|
|
5062
|
+
unlink: k,
|
|
5063
|
+
create: ne,
|
|
5064
|
+
check: w,
|
|
5065
|
+
pull: A,
|
|
5066
|
+
push: j,
|
|
5066
5067
|
clearMessages: () => {
|
|
5067
|
-
h(null), _(null);
|
|
5068
|
+
h(null), _(null), y([]);
|
|
5068
5069
|
}
|
|
5069
5070
|
};
|
|
5070
5071
|
}
|
|
@@ -5128,16 +5129,16 @@ var bo = (e) => {
|
|
|
5128
5129
|
})]
|
|
5129
5130
|
})]
|
|
5130
5131
|
}), Co = ({ sync: e, syncedAt: t, onReview: n }) => {
|
|
5131
|
-
let { phase: r, busy: i, error: a, notice: o,
|
|
5132
|
+
let { phase: r, busy: i, error: a, notice: o, warnings: s, counts: c, project: l, projects: u } = e, [d, f] = W(!1), [p, m] = W("My brand"), [h, g] = W("blank"), _ = U(!1);
|
|
5132
5133
|
V(() => {
|
|
5133
|
-
r === "connected" && !
|
|
5134
|
+
r === "connected" && !l && u === null && !_.current && (_.current = !0, e.loadProjects()), r !== "connected" && (_.current = !1);
|
|
5134
5135
|
}, [
|
|
5135
5136
|
r,
|
|
5136
|
-
c,
|
|
5137
5137
|
l,
|
|
5138
|
+
u,
|
|
5138
5139
|
e
|
|
5139
5140
|
]);
|
|
5140
|
-
let
|
|
5141
|
+
let v = "rounded-xl border border-px-accent-deep2 bg-gradient-to-b from-px-accent-deep to-px-accent-deep p-3 space-y-3", y = /* @__PURE__ */ q("div", {
|
|
5141
5142
|
className: "flex items-start gap-2",
|
|
5142
5143
|
children: [/* @__PURE__ */ K("div", {
|
|
5143
5144
|
className: "w-7 h-7 rounded-lg bg-px-accent text-px-onaccent flex items-center justify-center shrink-0 text-[11px] font-bold",
|
|
@@ -5152,7 +5153,7 @@ var bo = (e) => {
|
|
|
5152
5153
|
children: "Your brand, kept in one place and used everywhere."
|
|
5153
5154
|
})]
|
|
5154
5155
|
})]
|
|
5155
|
-
}),
|
|
5156
|
+
}), b = /* @__PURE__ */ q(G, { children: [
|
|
5156
5157
|
i && /* @__PURE__ */ q("div", {
|
|
5157
5158
|
className: "flex items-center gap-1.5 text-[11px] text-px-accent-soft",
|
|
5158
5159
|
children: [/* @__PURE__ */ K(we, { className: "w-3 h-3 animate-spin" }), i]
|
|
@@ -5169,19 +5170,42 @@ var bo = (e) => {
|
|
|
5169
5170
|
role: "status",
|
|
5170
5171
|
className: "flex items-start gap-1.5 text-[11px] text-px-accent-soft",
|
|
5171
5172
|
children: [/* @__PURE__ */ K(I, { className: "w-3.5 h-3.5 shrink-0 mt-0.5" }), /* @__PURE__ */ K("span", { children: o })]
|
|
5173
|
+
}),
|
|
5174
|
+
s.length > 0 && !a && /* @__PURE__ */ q("details", {
|
|
5175
|
+
open: !0,
|
|
5176
|
+
className: "rounded-lg bg-black/20 px-2.5 py-2",
|
|
5177
|
+
children: [/* @__PURE__ */ q("summary", {
|
|
5178
|
+
className: "text-[11px] text-px-text2 cursor-pointer list-none hover:text-white",
|
|
5179
|
+
children: [
|
|
5180
|
+
"What Strata mentioned (",
|
|
5181
|
+
s.length,
|
|
5182
|
+
")"
|
|
5183
|
+
]
|
|
5184
|
+
}), /* @__PURE__ */ K("ul", {
|
|
5185
|
+
className: "mt-1.5 space-y-1.5 text-[10px] text-px-muted leading-relaxed",
|
|
5186
|
+
style: {
|
|
5187
|
+
listStyle: "none",
|
|
5188
|
+
margin: 0,
|
|
5189
|
+
padding: 0
|
|
5190
|
+
},
|
|
5191
|
+
children: s.map((e, t) => /* @__PURE__ */ q("li", { children: [e.key && /* @__PURE__ */ K("span", {
|
|
5192
|
+
className: "block font-mono text-px-text2 break-all",
|
|
5193
|
+
children: e.key
|
|
5194
|
+
}), /* @__PURE__ */ K("span", { children: e.message })] }, t))
|
|
5195
|
+
})]
|
|
5172
5196
|
})
|
|
5173
5197
|
] });
|
|
5174
5198
|
if (r === "unknown") return /* @__PURE__ */ q("div", {
|
|
5175
|
-
className:
|
|
5176
|
-
children: [
|
|
5199
|
+
className: v,
|
|
5200
|
+
children: [y, /* @__PURE__ */ q("div", {
|
|
5177
5201
|
className: "flex items-center gap-1.5 text-[11px] text-px-muted",
|
|
5178
5202
|
children: [/* @__PURE__ */ K(we, { className: "w-3 h-3 animate-spin" }), "Checking…"]
|
|
5179
5203
|
})]
|
|
5180
5204
|
});
|
|
5181
5205
|
if (r === "disconnected" || r === "expired") return /* @__PURE__ */ q("div", {
|
|
5182
|
-
className:
|
|
5206
|
+
className: v,
|
|
5183
5207
|
children: [
|
|
5184
|
-
|
|
5208
|
+
y,
|
|
5185
5209
|
/* @__PURE__ */ K("p", {
|
|
5186
5210
|
className: "text-[11px] text-px-text2 leading-relaxed",
|
|
5187
5211
|
children: r === "expired" ? "Your Strata sign-in has run out." : "No Strata account yet? Connect with your Plexo account and one is made for you. Already have one? Sign in with it. You can switch to a different account any time."
|
|
@@ -5192,21 +5216,21 @@ var bo = (e) => {
|
|
|
5192
5216
|
disabled: !!i,
|
|
5193
5217
|
children: r === "expired" ? "Reconnect Strata" : "Connect Strata"
|
|
5194
5218
|
}),
|
|
5195
|
-
|
|
5219
|
+
b
|
|
5196
5220
|
]
|
|
5197
5221
|
});
|
|
5198
|
-
if (!
|
|
5199
|
-
className:
|
|
5222
|
+
if (!l) return /* @__PURE__ */ q("div", {
|
|
5223
|
+
className: v,
|
|
5200
5224
|
children: [
|
|
5201
|
-
|
|
5225
|
+
y,
|
|
5202
5226
|
/* @__PURE__ */ K(So, { sync: e }),
|
|
5203
|
-
|
|
5227
|
+
d ? /* @__PURE__ */ q("div", {
|
|
5204
5228
|
className: "space-y-2",
|
|
5205
5229
|
children: [
|
|
5206
5230
|
/* @__PURE__ */ K("input", {
|
|
5207
5231
|
className: fo,
|
|
5208
|
-
value:
|
|
5209
|
-
onChange: (e) =>
|
|
5232
|
+
value: p,
|
|
5233
|
+
onChange: (e) => m(e.target.value),
|
|
5210
5234
|
placeholder: "Project name",
|
|
5211
5235
|
"aria-label": "Strata project name"
|
|
5212
5236
|
}),
|
|
@@ -5225,9 +5249,9 @@ var bo = (e) => {
|
|
|
5225
5249
|
]].map(([e, t, n]) => /* @__PURE__ */ q("button", {
|
|
5226
5250
|
type: "button",
|
|
5227
5251
|
role: "radio",
|
|
5228
|
-
"aria-checked":
|
|
5229
|
-
onClick: () =>
|
|
5230
|
-
className: `w-full text-left rounded-lg border p-2 cursor-pointer transition-colors ${
|
|
5252
|
+
"aria-checked": h === e,
|
|
5253
|
+
onClick: () => g(e),
|
|
5254
|
+
className: `w-full text-left rounded-lg border p-2 cursor-pointer transition-colors ${h === e ? "border-px-accent bg-px-accent/10" : "border-px-line2 hover:border-px-line3"}`,
|
|
5231
5255
|
children: [/* @__PURE__ */ K("span", {
|
|
5232
5256
|
className: "block text-[11px] font-medium text-px-text",
|
|
5233
5257
|
children: t
|
|
@@ -5241,14 +5265,14 @@ var bo = (e) => {
|
|
|
5241
5265
|
className: "flex gap-2",
|
|
5242
5266
|
children: [/* @__PURE__ */ K(go, {
|
|
5243
5267
|
className: "flex-1",
|
|
5244
|
-
disabled: !!i || !
|
|
5268
|
+
disabled: !!i || !p.trim(),
|
|
5245
5269
|
onClick: () => void e.create({
|
|
5246
|
-
name:
|
|
5247
|
-
template:
|
|
5270
|
+
name: p,
|
|
5271
|
+
template: h
|
|
5248
5272
|
}),
|
|
5249
5273
|
children: "Create project"
|
|
5250
5274
|
}), /* @__PURE__ */ K(_o, {
|
|
5251
|
-
onClick: () =>
|
|
5275
|
+
onClick: () => f(!1),
|
|
5252
5276
|
children: "Cancel"
|
|
5253
5277
|
})]
|
|
5254
5278
|
})
|
|
@@ -5258,7 +5282,7 @@ var bo = (e) => {
|
|
|
5258
5282
|
children: [/* @__PURE__ */ K("div", {
|
|
5259
5283
|
className: "text-[11px] font-semibold text-px-text",
|
|
5260
5284
|
children: "Choose a project"
|
|
5261
|
-
}),
|
|
5285
|
+
}), u === null ? /* @__PURE__ */ K("div", {
|
|
5262
5286
|
className: "space-y-1.5",
|
|
5263
5287
|
"aria-label": "Loading your Strata projects",
|
|
5264
5288
|
children: [
|
|
@@ -5266,14 +5290,14 @@ var bo = (e) => {
|
|
|
5266
5290
|
1,
|
|
5267
5291
|
2
|
|
5268
5292
|
].map((e) => /* @__PURE__ */ K("div", { className: "h-11 rounded-xl bg-black/20 animate-pulse" }, e))
|
|
5269
|
-
}) :
|
|
5293
|
+
}) : u.length === 0 ? /* @__PURE__ */ K("p", {
|
|
5270
5294
|
className: "text-[11px] text-px-text2 leading-relaxed rounded-xl bg-black/20 px-3 py-2.5",
|
|
5271
5295
|
children: "You don’t have a Strata project yet. Create one and your brand goes straight in."
|
|
5272
5296
|
}) : /* @__PURE__ */ K("div", {
|
|
5273
5297
|
role: "list",
|
|
5274
5298
|
className: "space-y-1.5 max-h-56 overflow-y-auto",
|
|
5275
5299
|
"aria-label": "Your Strata projects",
|
|
5276
|
-
children:
|
|
5300
|
+
children: u.map((t) => /* @__PURE__ */ K("div", {
|
|
5277
5301
|
role: "listitem",
|
|
5278
5302
|
children: /* @__PURE__ */ q("button", {
|
|
5279
5303
|
type: "button",
|
|
@@ -5303,62 +5327,62 @@ var bo = (e) => {
|
|
|
5303
5327
|
})]
|
|
5304
5328
|
}), /* @__PURE__ */ q(_o, {
|
|
5305
5329
|
className: "w-full flex items-center justify-center gap-1.5",
|
|
5306
|
-
onClick: () =>
|
|
5330
|
+
onClick: () => f(!0),
|
|
5307
5331
|
disabled: !!i,
|
|
5308
5332
|
children: [/* @__PURE__ */ K(F, { className: "w-3 h-3" }), "Create a new project"]
|
|
5309
5333
|
})] }),
|
|
5310
|
-
|
|
5334
|
+
b
|
|
5311
5335
|
]
|
|
5312
5336
|
});
|
|
5313
|
-
let
|
|
5337
|
+
let x = c.incoming + c.outgoing + c.conflicts === 0;
|
|
5314
5338
|
return /* @__PURE__ */ q("div", {
|
|
5315
|
-
className:
|
|
5339
|
+
className: v,
|
|
5316
5340
|
children: [
|
|
5317
|
-
|
|
5341
|
+
y,
|
|
5318
5342
|
/* @__PURE__ */ K(So, { sync: e }),
|
|
5319
5343
|
/* @__PURE__ */ q("div", {
|
|
5320
5344
|
className: "rounded-lg bg-black/25 px-2.5 py-2",
|
|
5321
5345
|
children: [/* @__PURE__ */ K("div", {
|
|
5322
5346
|
className: "text-[11px] font-medium text-px-text truncate",
|
|
5323
|
-
children:
|
|
5347
|
+
children: l.name ?? "Strata project"
|
|
5324
5348
|
}), /* @__PURE__ */ K("div", {
|
|
5325
5349
|
className: "text-[10px] text-px-muted",
|
|
5326
5350
|
children: t ? `Synced ${bo(t)}` : "Not synced yet"
|
|
5327
5351
|
})]
|
|
5328
5352
|
}),
|
|
5329
|
-
e.plan ?
|
|
5353
|
+
e.plan ? x ? /* @__PURE__ */ q("div", {
|
|
5330
5354
|
className: "flex items-center gap-1.5 text-[11px] text-px-accent-soft",
|
|
5331
5355
|
children: [/* @__PURE__ */ K(I, { className: "w-3.5 h-3.5" }), "Everything matches Strata."]
|
|
5332
5356
|
}) : /* @__PURE__ */ q("div", {
|
|
5333
5357
|
className: "space-y-1",
|
|
5334
5358
|
children: [
|
|
5335
|
-
|
|
5359
|
+
c.incoming > 0 && /* @__PURE__ */ q("div", {
|
|
5336
5360
|
className: "flex items-center gap-1.5 text-[11px] text-px-text2",
|
|
5337
5361
|
children: [
|
|
5338
5362
|
/* @__PURE__ */ K(te, { className: "w-3 h-3 text-px-accent" }),
|
|
5339
|
-
|
|
5363
|
+
c.incoming,
|
|
5340
5364
|
" update",
|
|
5341
|
-
|
|
5365
|
+
c.incoming === 1 ? "" : "s",
|
|
5342
5366
|
" waiting in Strata. “Get updates” brings ",
|
|
5343
|
-
|
|
5367
|
+
c.incoming === 1 ? "it" : "them",
|
|
5344
5368
|
" in."
|
|
5345
5369
|
]
|
|
5346
5370
|
}),
|
|
5347
|
-
|
|
5371
|
+
c.outgoing > 0 && /* @__PURE__ */ q("div", {
|
|
5348
5372
|
className: "flex items-center gap-1.5 text-[11px] text-px-text2",
|
|
5349
5373
|
children: [
|
|
5350
5374
|
/* @__PURE__ */ K(L, { className: "w-3 h-3 text-px-accent" }),
|
|
5351
|
-
|
|
5375
|
+
c.outgoing,
|
|
5352
5376
|
" new or changed here. “Send to Strata” shares ",
|
|
5353
|
-
|
|
5377
|
+
c.outgoing === 1 ? "it" : "them",
|
|
5354
5378
|
"."
|
|
5355
5379
|
]
|
|
5356
5380
|
}),
|
|
5357
|
-
|
|
5381
|
+
c.conflicts > 0 && /* @__PURE__ */ q("div", {
|
|
5358
5382
|
className: "flex items-center gap-1.5 text-[11px] text-amber-200",
|
|
5359
5383
|
children: [
|
|
5360
5384
|
/* @__PURE__ */ K(Ne, { className: "w-3 h-3" }),
|
|
5361
|
-
|
|
5385
|
+
c.conflicts,
|
|
5362
5386
|
" changed in both — you decide"
|
|
5363
5387
|
]
|
|
5364
5388
|
})
|
|
@@ -5367,12 +5391,12 @@ var bo = (e) => {
|
|
|
5367
5391
|
/* @__PURE__ */ q("div", {
|
|
5368
5392
|
className: "space-y-2",
|
|
5369
5393
|
children: [/* @__PURE__ */ q(_o, {
|
|
5370
|
-
disabled: !!i || !e.plan ||
|
|
5394
|
+
disabled: !!i || !e.plan || c.incoming === 0,
|
|
5371
5395
|
onClick: () => void e.pull(),
|
|
5372
5396
|
className: "w-full h-9 flex items-center justify-center gap-2",
|
|
5373
5397
|
children: [/* @__PURE__ */ K(te, { className: "w-3.5 h-3.5 shrink-0" }), "Get updates from Strata"]
|
|
5374
5398
|
}), /* @__PURE__ */ q(go, {
|
|
5375
|
-
disabled: !!i || !e.plan ||
|
|
5399
|
+
disabled: !!i || !e.plan || c.outgoing === 0,
|
|
5376
5400
|
onClick: () => void e.push(),
|
|
5377
5401
|
className: "w-full h-9 flex items-center justify-center gap-2",
|
|
5378
5402
|
children: [/* @__PURE__ */ K(L, { className: "w-3.5 h-3.5 shrink-0" }), "Send to Strata"]
|
|
@@ -5413,7 +5437,7 @@ var bo = (e) => {
|
|
|
5413
5437
|
className: "inline-flex items-center gap-1 cursor-pointer hover:text-px-text disabled:opacity-50",
|
|
5414
5438
|
children: [/* @__PURE__ */ K(se, { className: "w-3 h-3" }), "Check Strata again"]
|
|
5415
5439
|
}),
|
|
5416
|
-
!
|
|
5440
|
+
!x && /* @__PURE__ */ K("button", {
|
|
5417
5441
|
type: "button",
|
|
5418
5442
|
onClick: n,
|
|
5419
5443
|
className: "underline cursor-pointer hover:text-px-text",
|
|
@@ -5427,7 +5451,7 @@ var bo = (e) => {
|
|
|
5427
5451
|
})
|
|
5428
5452
|
]
|
|
5429
5453
|
}),
|
|
5430
|
-
|
|
5454
|
+
b
|
|
5431
5455
|
]
|
|
5432
5456
|
});
|
|
5433
5457
|
}, wo = ({ token: e, missing: t }) => {
|
package/package.json
CHANGED