@strands.gg/accui 1.7.2 → 1.7.3
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/accui.css +193 -143
- package/dist/strands-auth-ui.cjs.js +55 -38
- package/dist/strands-auth-ui.cjs.js.map +1 -1
- package/dist/strands-auth-ui.es.js +55 -38
- package/dist/strands-auth-ui.es.js.map +1 -1
- package/package.json +1 -1
|
@@ -6969,12 +6969,12 @@ const _hoisted_2$5 = { class: "profile-image-section" };
|
|
|
6969
6969
|
const _hoisted_3$5 = { class: "profile-image-container" };
|
|
6970
6970
|
const _hoisted_4$4 = { class: "profile-image-wrapper" };
|
|
6971
6971
|
const _hoisted_5$4 = {
|
|
6972
|
-
key:
|
|
6972
|
+
key: 0,
|
|
6973
6973
|
class: "profile-avatar profile-avatar-with-image"
|
|
6974
6974
|
};
|
|
6975
6975
|
const _hoisted_6$2 = ["src", "alt"];
|
|
6976
6976
|
const _hoisted_7$2 = {
|
|
6977
|
-
key:
|
|
6977
|
+
key: 1,
|
|
6978
6978
|
class: "profile-avatar profile-avatar-initials"
|
|
6979
6979
|
};
|
|
6980
6980
|
const _hoisted_8$2 = ["disabled"];
|
|
@@ -7653,16 +7653,15 @@ const _sfc_main$8 = /* @__PURE__ */ vue.defineComponent({
|
|
|
7653
7653
|
vue.createElementVNode("div", _hoisted_2$5, [
|
|
7654
7654
|
vue.createElementVNode("div", _hoisted_3$5, [
|
|
7655
7655
|
vue.createElementVNode("div", _hoisted_4$4, [
|
|
7656
|
-
|
|
7657
|
-
key: 0,
|
|
7656
|
+
vue.createVNode(vue.unref(StrandsUiLevelProgress), {
|
|
7658
7657
|
size: 140,
|
|
7659
|
-
value: currentUser.value
|
|
7660
|
-
max: currentUser.value
|
|
7661
|
-
level: currentUser.value
|
|
7662
|
-
"level-label": `LEVEL ${currentUser.value
|
|
7663
|
-
"user-settings": currentUser.value
|
|
7658
|
+
value: currentUser.value?.xp || 0,
|
|
7659
|
+
max: currentUser.value?.next_level_xp || 1,
|
|
7660
|
+
level: currentUser.value?.level || 0,
|
|
7661
|
+
"level-label": `LEVEL ${currentUser.value?.level || 0}`,
|
|
7662
|
+
"user-settings": currentUser.value?.settings,
|
|
7664
7663
|
class: "profile-progress-ring"
|
|
7665
|
-
}, null, 8, ["value", "max", "level", "level-label", "user-settings"])
|
|
7664
|
+
}, null, 8, ["value", "max", "level", "level-label", "user-settings"]),
|
|
7666
7665
|
currentUser.value?.avatar ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5$4, [
|
|
7667
7666
|
vue.createElementVNode("img", {
|
|
7668
7667
|
src: currentUser.value.avatar,
|
|
@@ -8128,7 +8127,7 @@ const _sfc_main$8 = /* @__PURE__ */ vue.defineComponent({
|
|
|
8128
8127
|
};
|
|
8129
8128
|
}
|
|
8130
8129
|
});
|
|
8131
|
-
const StrandsUserProfile = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-
|
|
8130
|
+
const StrandsUserProfile = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-b880e15b"]]);
|
|
8132
8131
|
const _hoisted_1$6 = { class: "accui-component-scope" };
|
|
8133
8132
|
const _hoisted_2$4 = { class: "accui-w-full accui-min-w-100 accui-max-w-md accui-mx-auto accui-animate-slide-up" };
|
|
8134
8133
|
const _hoisted_3$4 = { class: "accui-mt-8 accui-text-center" };
|
|
@@ -8556,10 +8555,15 @@ const _hoisted_3$2 = {
|
|
|
8556
8555
|
const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
|
|
8557
8556
|
__name: "SignedIn",
|
|
8558
8557
|
props: {
|
|
8559
|
-
showFallback: { type: Boolean, default: true }
|
|
8558
|
+
showFallback: { type: Boolean, default: true },
|
|
8559
|
+
invert: { type: Boolean, default: false }
|
|
8560
8560
|
},
|
|
8561
8561
|
emits: ["sign-in-required"],
|
|
8562
8562
|
setup(__props, { emit: __emit }) {
|
|
8563
|
+
const props = __props;
|
|
8564
|
+
const invert = props.invert ?? false;
|
|
8565
|
+
const signedInOrInverted = vue.computed(() => (isAuthenticated.value && !invert || !isAuthenticated.value && invert) && !showLoading.value);
|
|
8566
|
+
const signedOutOrInverted = vue.computed(() => (isAuthenticated.value && invert || !isAuthenticated.value && !invert) && props.showFallback && !showLoading.value);
|
|
8563
8567
|
const emit = __emit;
|
|
8564
8568
|
const isComponentReady = vue.ref(false);
|
|
8565
8569
|
const { isAuthenticated, isInitializing, isSigningIn, user, signOut } = useStrandsAuth.useStrandsAuth();
|
|
@@ -8573,15 +8577,16 @@ const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
|
|
|
8573
8577
|
emit("sign-in-required");
|
|
8574
8578
|
};
|
|
8575
8579
|
return (_ctx, _cache) => {
|
|
8576
|
-
return
|
|
8580
|
+
return signedInOrInverted.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$4, [
|
|
8577
8581
|
vue.renderSlot(_ctx.$slots, "default", {
|
|
8578
8582
|
user: vue.unref(user),
|
|
8579
|
-
signOut: vue.unref(signOut)
|
|
8583
|
+
signOut: vue.unref(signOut),
|
|
8584
|
+
invert: vue.unref(invert)
|
|
8580
8585
|
}, void 0, true)
|
|
8581
|
-
])) :
|
|
8586
|
+
])) : signedOutOrInverted.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$2, [
|
|
8582
8587
|
vue.renderSlot(_ctx.$slots, "fallback", { signIn }, () => [
|
|
8583
8588
|
vue.createElementVNode("div", { class: "signed-in-fallback" }, [
|
|
8584
|
-
_cache[0] || (_cache[0] = vue.createStaticVNode('<div class="signed-in-icon-container" data-v-
|
|
8589
|
+
_cache[0] || (_cache[0] = vue.createStaticVNode('<div class="signed-in-icon-container" data-v-669fa3b4><svg class="signed-in-icon" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-669fa3b4><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z" data-v-669fa3b4></path></svg></div><h3 class="signed-in-title" data-v-669fa3b4>Sign in required</h3><p class="signed-in-subtitle" data-v-669fa3b4>You need to be signed in to access this content.</p>', 3)),
|
|
8585
8590
|
vue.createElementVNode("button", {
|
|
8586
8591
|
onClick: signIn,
|
|
8587
8592
|
class: "signed-in-button"
|
|
@@ -8601,7 +8606,7 @@ const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
|
|
|
8601
8606
|
};
|
|
8602
8607
|
}
|
|
8603
8608
|
});
|
|
8604
|
-
const SignedIn = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-
|
|
8609
|
+
const SignedIn = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-669fa3b4"]]);
|
|
8605
8610
|
const _hoisted_1$3 = {
|
|
8606
8611
|
key: 0,
|
|
8607
8612
|
class: "animate-fade-in"
|
|
@@ -8901,17 +8906,22 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
8901
8906
|
props: {
|
|
8902
8907
|
hideUser: { type: Boolean, default: false },
|
|
8903
8908
|
variant: { default: "minimal" },
|
|
8904
|
-
redirectUrl: { default: "/" }
|
|
8909
|
+
redirectUrl: { default: "/" },
|
|
8910
|
+
user: { default: void 0 },
|
|
8911
|
+
menuAlign: { default: "right" },
|
|
8912
|
+
menuVerticalAlign: { default: "bottom" }
|
|
8905
8913
|
},
|
|
8906
8914
|
emits: ["profile-updated", "signed-out", "signed-in"],
|
|
8907
8915
|
setup(__props, { emit: __emit }) {
|
|
8916
|
+
const props = __props;
|
|
8908
8917
|
const emit = __emit;
|
|
8909
|
-
const { currentUser
|
|
8918
|
+
const { currentUser, signOut } = useStrandsAuth.useStrandsAuth();
|
|
8910
8919
|
const showDropdown = vue.ref(false);
|
|
8911
8920
|
const showProfileModal = vue.ref(false);
|
|
8912
8921
|
const showSignInModal = vue.ref(false);
|
|
8913
8922
|
const containerRef = vue.ref();
|
|
8914
8923
|
const profileButtonRef = vue.ref();
|
|
8924
|
+
const user = vue.computed(() => props.user || currentUser.value);
|
|
8915
8925
|
const displayName = vue.computed(() => {
|
|
8916
8926
|
if (!user.value) return "User";
|
|
8917
8927
|
if (user.value.username) {
|
|
@@ -9003,7 +9013,9 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
9003
9013
|
ref_key: "containerRef",
|
|
9004
9014
|
ref: containerRef
|
|
9005
9015
|
}, [
|
|
9006
|
-
vue.createVNode(vue.unref(SignedIn),
|
|
9016
|
+
vue.createVNode(vue.unref(SignedIn), {
|
|
9017
|
+
invert: !!props.user
|
|
9018
|
+
}, {
|
|
9007
9019
|
fallback: vue.withCtx(() => [
|
|
9008
9020
|
vue.createElementVNode("button", {
|
|
9009
9021
|
onClick: openSignIn,
|
|
@@ -9085,10 +9097,10 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
9085
9097
|
])) : vue.createCommentVNode("", true),
|
|
9086
9098
|
vue.createElementVNode("div", _hoisted_5, [
|
|
9087
9099
|
vue.createElementVNode("div", _hoisted_6, [
|
|
9088
|
-
|
|
9100
|
+
user.value?.avatar ? (vue.openBlock(), vue.createElementBlock("img", {
|
|
9089
9101
|
key: 0,
|
|
9090
|
-
src:
|
|
9091
|
-
alt: `${
|
|
9102
|
+
src: user.value.avatar,
|
|
9103
|
+
alt: `${user.value.firstName || user.value.email}'s avatar`,
|
|
9092
9104
|
class: "avatar-image"
|
|
9093
9105
|
}, null, 8, _hoisted_7)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_8, _cache[0] || (_cache[0] = [
|
|
9094
9106
|
vue.createElementVNode("svg", {
|
|
@@ -9123,7 +9135,11 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
9123
9135
|
default: vue.withCtx(() => [
|
|
9124
9136
|
showDropdown.value ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
9125
9137
|
key: 0,
|
|
9126
|
-
class:
|
|
9138
|
+
class: vue.normalizeClass([
|
|
9139
|
+
"dropdown-menu",
|
|
9140
|
+
`dropdown-menu-align-${props.menuAlign}`,
|
|
9141
|
+
`dropdown-menu-vertical-${props.menuVerticalAlign}`
|
|
9142
|
+
]),
|
|
9127
9143
|
role: "menu",
|
|
9128
9144
|
"aria-orientation": "vertical",
|
|
9129
9145
|
onKeydown: [
|
|
@@ -9136,20 +9152,20 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
9136
9152
|
}, [
|
|
9137
9153
|
vue.createElementVNode("div", _hoisted_10, [
|
|
9138
9154
|
vue.createElementVNode("div", _hoisted_11, [
|
|
9139
|
-
|
|
9155
|
+
user.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_12, [
|
|
9140
9156
|
vue.createVNode(vue.unref(StrandsUiLevelProgress), {
|
|
9141
9157
|
size: 80,
|
|
9142
|
-
value:
|
|
9143
|
-
max:
|
|
9144
|
-
level:
|
|
9145
|
-
"level-label": `LEVEL ${
|
|
9146
|
-
"user-settings":
|
|
9158
|
+
value: user.value.xp,
|
|
9159
|
+
max: user.value.next_level_xp,
|
|
9160
|
+
level: user.value.level,
|
|
9161
|
+
"level-label": `LEVEL ${user.value.level}`,
|
|
9162
|
+
"user-settings": user.value.settings,
|
|
9147
9163
|
class: "level-progress-overlay"
|
|
9148
9164
|
}, null, 8, ["value", "max", "level", "level-label", "user-settings"]),
|
|
9149
|
-
|
|
9165
|
+
user.value?.avatar ? (vue.openBlock(), vue.createElementBlock("img", {
|
|
9150
9166
|
key: 0,
|
|
9151
|
-
src:
|
|
9152
|
-
alt: `${
|
|
9167
|
+
src: user.value.avatar,
|
|
9168
|
+
alt: `${user.value.firstName || user.value.email}'s avatar`,
|
|
9153
9169
|
class: "dropdown-avatar-image"
|
|
9154
9170
|
}, null, 8, _hoisted_13)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_14, _cache[2] || (_cache[2] = [
|
|
9155
9171
|
vue.createElementVNode("svg", {
|
|
@@ -9167,7 +9183,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
9167
9183
|
])) : vue.createCommentVNode("", true),
|
|
9168
9184
|
vue.createElementVNode("div", _hoisted_15, [
|
|
9169
9185
|
vue.createElementVNode("div", _hoisted_16, vue.toDisplayString(displayName.value), 1),
|
|
9170
|
-
vue.createElementVNode("div", _hoisted_17, vue.toDisplayString(
|
|
9186
|
+
vue.createElementVNode("div", _hoisted_17, vue.toDisplayString(user.value?.email), 1)
|
|
9171
9187
|
])
|
|
9172
9188
|
]),
|
|
9173
9189
|
_cache[5] || (_cache[5] = vue.createElementVNode("div", { class: "dropdown-divider" }, null, -1)),
|
|
@@ -9218,7 +9234,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
9218
9234
|
]))
|
|
9219
9235
|
])
|
|
9220
9236
|
])
|
|
9221
|
-
],
|
|
9237
|
+
], 42, _hoisted_9)) : vue.createCommentVNode("", true)
|
|
9222
9238
|
]),
|
|
9223
9239
|
_: 1
|
|
9224
9240
|
})
|
|
@@ -9254,21 +9270,22 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
9254
9270
|
]),
|
|
9255
9271
|
default: vue.withCtx(() => [
|
|
9256
9272
|
vue.createVNode(vue.unref(StrandsUserProfile), {
|
|
9273
|
+
user: user.value,
|
|
9257
9274
|
onProfileUpdated: handleProfileUpdated,
|
|
9258
9275
|
onError: handleProfileError,
|
|
9259
9276
|
"in-modal": ""
|
|
9260
|
-
})
|
|
9277
|
+
}, null, 8, ["user"])
|
|
9261
9278
|
]),
|
|
9262
9279
|
_: 1
|
|
9263
9280
|
}, 8, ["open"])
|
|
9264
9281
|
]),
|
|
9265
9282
|
_: 1
|
|
9266
|
-
})
|
|
9283
|
+
}, 8, ["invert"])
|
|
9267
9284
|
], 512);
|
|
9268
9285
|
};
|
|
9269
9286
|
}
|
|
9270
9287
|
});
|
|
9271
|
-
const StrandsUserButton = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
9288
|
+
const StrandsUserButton = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-9e187d2c"]]);
|
|
9272
9289
|
const components = {
|
|
9273
9290
|
StrandsUiAlert,
|
|
9274
9291
|
StrandsUiButton,
|