Skip to content

Commit

Permalink
deploy: d94fb94
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Sep 8, 2023
1 parent 9eace2d commit 34f43f3
Show file tree
Hide file tree
Showing 11 changed files with 3,683 additions and 3,586 deletions.
2 changes: 1 addition & 1 deletion feed.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</image>
<generator>razor-ssg</generator>
<copyright></copyright>
<lastBuildDate>Fri, 08 Sep 2023 03:30:14 GMT</lastBuildDate>
<lastBuildDate>Fri, 08 Sep 2023 03:36:56 GMT</lastBuildDate>
<managingEditor>team@servicestack.net (Team ServiceStack)</managingEditor>
<webMaster>team@servicestack.net (Team ServiceStack)</webMaster>
<atom:link href="https://jamstacks.net/feed.xml" rel="self" type="application/rss+xml" />
Expand Down
2 changes: 1 addition & 1 deletion lib/mjs/servicestack-client.min.mjs

Large diffs are not rendered by default.

29 changes: 22 additions & 7 deletions lib/mjs/servicestack-client.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -997,7 +997,7 @@ export class JsonServiceClient {
}).catch(error => {
// No responseStatus body, set from `res` Body object
if (error instanceof Error
|| (typeof window != "undefined" && error instanceof window.DOMException /*MS Edge*/)) {
|| (typeof window != "undefined" && window.DOMException && error instanceof window.DOMException /*MS Edge*/)) {
throw this.raiseError(res, createErrorResponse(res.status, res.statusText, type));
}
throw this.raiseError(res, error);
Expand Down Expand Up @@ -1694,14 +1694,17 @@ function bsAlert(msg) { return '<div class="alert alert-danger">' + msg + '</div
function attr(e, name) { return e.getAttribute(name); }
function sattr(e, name, value) { return e.setAttribute(name, value); }
function rattr(e, name) { return e.removeAttribute(name); }
export function createElement(tagName, options, attrs) {
export function createElement(tagName, options) {
const keyAliases = { className: 'class', htmlFor: 'for' };
const el = document.createElement(tagName);
if (attrs) {
for (const key in attrs) {
sattr(el, keyAliases[key] || key, attrs[key]);
if (options?.attrs) {
for (const key in options.attrs) {
sattr(el, keyAliases[key] || key, options.attrs[key]);
}
}
if (options?.events) {
on(el, options.events);
}
if (options && options.insertAfter) {
options.insertAfter.parentNode.insertBefore(el, options.insertAfter.nextSibling);
}
Expand All @@ -1723,7 +1726,7 @@ function showInvalidInputs() {
: this;
const elError = elLast != null && elLast.nextElementSibling && hasClass(elLast.nextElementSibling, 'invalid-feedback')
? elLast.nextElementSibling
: createElement("div", { insertAfter: elLast }, { className: 'invalid-feedback' });
: createElement("div", { insertAfter: elLast, attrs: { className: 'invalid-feedback' } });
elError.innerHTML = errorMsg;
}
}
Expand Down Expand Up @@ -1766,10 +1769,22 @@ export function on(sel, handlers) {
Object.keys(handlers).forEach(function (evt) {
let fn = handlers[evt];
if (typeof evt === 'string' && typeof fn === 'function') {
e.addEventListener(evt, fn.bind(e));
e.addEventListener(evt, handlers[evt] = fn.bind(e));
}
});
});
return handlers;
}
export function addScript(src) {
return new Promise((resolve, reject) => {
document.body.appendChild(createElement('script', {
attrs: { src },
events: {
load: resolve,
error: reject,
}
}));
});
}
export function delaySet(f, opt) {
let duration = opt && opt.duration || 300;
Expand Down
48 changes: 24 additions & 24 deletions lib/mjs/servicestack-vue.min.mjs

Large diffs are not rendered by default.

7,089 changes: 3,573 additions & 3,516 deletions lib/mjs/servicestack-vue.mjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/mjs/vue.min.mjs

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions lib/mjs/vue.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ function normalizeStyle(value) {
}
const listDelimiterRE = /;(?![^(]*\))/g;
const propertyDelimiterRE = /:([^]+)/;
const styleCommentRE = new RegExp("\\/\\*.*?\\*\\/", "gs");
const styleCommentRE = /\/\*[^]*?\*\//g;
function parseStringStyle(cssText) {
const ret = {};
cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => {
Expand Down Expand Up @@ -9093,7 +9093,7 @@ function isMemoSame(cached, memo) {
return true;
}

const version = "3.3.2";
const version = "3.3.4";
const ssrUtils = null;
const resolveFilter = null;
const compatUtils = null;
Expand Down
87 changes: 56 additions & 31 deletions lib/tailwind/creatorkit.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,14 +282,11 @@ export class RegisterResponse {
/** @type {{ [index: string]: string; }} */
meta;
}
import { $$, enc, JsonApiClient } from "@servicestack/client";
import { createApp, reactive } from "vue";
import { $$, JsonApiClient, leftPart } from "@servicestack/client"
import { createApp, reactive } from "vue"
import ServiceStackVue from "@servicestack/vue"

export const BaseUrl = location.origin === 'https://localhost:5002'
? 'https://localhost:5001'
: 'https://ssg-services.servicestack.net'

export const BaseUrl = leftPart(import.meta.url, '/mjs')

let AppData = {
init: false,
Expand Down Expand Up @@ -578,7 +575,7 @@ export const MarkdownEmailInput = {
}import { computed, onMounted, ref } from "vue"
import { $$, appendQueryString, combinePaths, queryString, rightPart } from "@servicestack/client"
import ServiceStackVue, { useClient } from "@servicestack/vue"
import { SubscribeToMailingList, QueryContacts, UpdateContact } from "../Mail.dtos.mjs"
import { SubscribeToMailingList, UpdateContactMailingLists, FindContact } from "../Mail.dtos.mjs"
import { BaseUrl, mount } from "./init.mjs"

export const JoinMailingList = {
Expand Down Expand Up @@ -640,20 +637,30 @@ export const JoinMailingList = {

export const MailPreferences = {
template:`<div>
<div v-if="saved" class="text-3xl font-bold tracking-tight text-gray-900 sm:text-4xl lg:col-span-7">
<Loading v-if="!loaded">Loading...</Loading>
<div v-else-if="saved" class="text-3xl font-bold tracking-tight text-gray-900 sm:text-4xl lg:col-span-7">
<div class="flex justify-center">
<svg class="my-4 w-16 h-16 text-green-600" xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 15 15"><path fill="none" stroke="currentColor" d="M4 7.5L7 10l4-5m-3.5 9.5a7 7 0 1 1 0-14a7 7 0 0 1 0 14Z"/></svg>
</div>
<h2 class="mb-3 inline sm:block lg:inline xl:block">Updated!</h2>
<p class="inline sm:block lg:inline xl:block">Your email preferences have been saved.</p>
<h2 class="mb-3 inline sm:block lg:inline xl:block">{{ updatedHeading || 'Updated!' }}</h2>
<p class="inline sm:block lg:inline xl:block">{{ updatedMessage || 'Your email preferences have been saved.' }}</p>
</div>
<div v-else-if="unsubscribed" class="text-gray-900 sm:text-4xl lg:col-span-7">
<div class="flex justify-center">
<svg class="my-4 w-16 h-16 text-indigo-600" xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-width="4"><path d="m35 26.614l-19.854-19.3a2.928 2.928 0 0 0-4.259.188a3.334 3.334 0 0 0 .18 4.544l10.024 9.93"/><path stroke-linejoin="round" d="M21.09 21.976L10.178 11.155a3.486 3.486 0 0 0-4.735-.161a3.032 3.032 0 0 0-.18 4.417l10.993 11.203"/><path d="M16.255 26.614L10 20.5a3.299 3.299 0 0 0-4.633-.08a3.233 3.233 0 0 0-.093 4.588c9.23 9.536 14.02 14.04 15.817 15.545C24 42.99 29.735 44 32.73 42c2.995-2 5.702-4.846 6.987-7.671c.765-1.683 2.25-6.87 4.458-15.561a3.305 3.305 0 0 0-2.46-4.034a3.5 3.5 0 0 0-4.166 2.493L35 26.614m-3.284-13.948a19.597 19.597 0 0 0-8.752-7.187M5.194 33.776a19.599 19.599 0 0 0 8.364 7.635"/></g></svg>
</div>
<h2 class="mb-3 text-3xl font-bold tracking-tight inline sm:block lg:inline xl:block">{{ unsubscribeHeading || 'Updated!' }}</h2>
<p class="text-2xl inline sm:block lg:inline xl:block">
{{ unsubscribeMessage || "You've been unsubscribed from all email subscriptions, we're sorry to see you go!" }}
</p>
</div>
<div v-else-if="contact">
<div v-if="unsubscribe">
<div v-if="unsubscribeView">
<p class="mb-3">
Unsubscribe from all future email communications:
{{ unsubscribePrompt || 'Unsubscribe from all future email communications:' }}
</p>
<div class="my-8 flex justify-center">
<PrimaryButton type="button" color="red">Unsubscribe</PrimaryButton>
<PrimaryButton type="button" color="red" @click="submitUnsubscribe">{{ submitUnsubscribeLabel || 'Unsubscribe' }}</PrimaryButton>
</div>
</div>
<p class="mb-3">
Expand All @@ -667,38 +674,41 @@ export const MailPreferences = {
<label class="select-none ml-3 text-sm font-medium leading-6 text-gray-900 dark:text-gray-50" :for="'chk-'+value">{{mailingListType.enumDescriptions[index] || mailingListType.enumNames[index]}}</label>
</div>
</div>
<PrimaryButton class="mt-8">Save Changes</PrimaryButton>
<PrimaryButton class="mt-8">{{ submitLabel || 'Save Changes' }}</PrimaryButton>
</div>
</form>
</div>
<div v-else>
<p>
Enter your email to manage your email preferences:
{{ emailPrompt || 'Enter your email to manage your email preferences:' }}
</p>
<ErrorSummary class="my-3" />
<form @submit.prevent="findContact" class="space-x-4 flex items-end">
<div><TextInput id="email" v-model="email" label="" placeholder="Enter your email" /></div>
<div><PrimaryButton>Submit</PrimaryButton></div>
<div><PrimaryButton>{{ submitEmailLabel || 'Submit' }}</PrimaryButton></div>
</form>
</div>
</div>`,
props:['emailPrompt','submitEmailPrompt','updatedHeading','updatedMessage','unsubscribePrompt','unsubscribeHeading','unsubscribeMessage','submitLabel','submitUnsubscribeLabel'],
setup(props) {
const client = useClient()
const contact = ref()
const email = ref()
const metadata = ref()
const mailingListType = computed(() => metadata.value?.api.types.find(x => x.name === 'MailingList'))
const contactMailingLists = ref([])
const saved = ref(false)
const unsubscribe = ref(false)
const saved = ref(false)
const unsubscribeView = ref(false)
const unsubscribed = ref(false)
const loaded = ref(false)

async function findContact(e) {
if (!email.value) return
const api = await client.api(new QueryContacts({
const api = await client.api(new FindContact({
email: email.value,
}))
if (api.succeeded) {
contact.value = api.response.results[0]
contact.value = api.response.result
if (contact.value) {
contactMailingLists.value = enumFlags(contact.value.mailingLists)
} else {
Expand All @@ -707,9 +717,19 @@ export const MailPreferences = {
}
}

async function submitUnsubscribe(e) {
const api = await client.apiVoid(new UpdateContactMailingLists({
ref: contact.value.externalRef,
unsubscribeFromAll: true,
}))
if (api.succeeded) {
unsubscribed.value = true
}
}

async function submit(e) {
const api = await client.api(new UpdateContact({
id: contact.value.id,
const api = await client.apiVoid(new UpdateContactMailingLists({
ref: contact.value.externalRef,
mailingLists: contactMailingLists.value
}))
if (api.succeeded) {
Expand All @@ -736,22 +756,23 @@ export const MailPreferences = {
const search = location.search ? location.search : location.hash.includes('?') ? '?' + rightPart(location.hash,'?') : ''
let qs = queryString(search)
if (qs.email || qs.ref) {
const api = await client.api(new QueryContacts({
const api = await client.api(new FindContact({
email: qs.email,
externalRef: qs.ref
ref: qs.ref
}))
if (api.succeeded) {
contact.value = api.response.results[0]
contact.value = api.response.result
if (contact.value) {
contactMailingLists.value = enumFlags(contact.value.mailingLists)
}
}
}
unsubscribe.value = !!qs.unsubscribe
loaded.value = true
unsubscribeView.value = !!qs.unsubscribe
})

return { contact, email, findContact, submit, enumFlags, mailingListType, contactMailingLists, saved,
unsubscribe }
return { loaded, contact, email, findContact, submit, enumFlags, mailingListType, contactMailingLists, saved,
unsubscribeView, unsubscribed, submitUnsubscribe }
}
}

Expand Down Expand Up @@ -1025,7 +1046,8 @@ const Comment = {
</div>
</div>
<div class="py-2 text-gray-900 dark:text-gray-50">
{{comment.content}}
<span v-if="comment.flagReason" class="text-gray-500 text-sm">[flagged]</span>
<span v-else>{{comment.content}}</span>
</div>
<div class="text-sm text-gray-600 dark:text-gray-300 flex justify-between h-6">
<div class="flex items-center">
Expand Down Expand Up @@ -1220,7 +1242,7 @@ export const PostComments = {
components: { ThreadDialogs, Thread, Comment, InputComment, NewReport },
template: /*html*/`
<div class="mt-24 mx-auto flex flex-col w-full max-w-3xl transition-opacity">
<div class="mb-12 flex">
<div v-if="!hide.includes('threadLikes')" class="mb-12 flex">
<div @click="toggleLike" class="cursor-pointer flex items-center select-none">
<svg v-if="!store.userData?.liked" class="text-gray-700 w-8 h-8" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><title>Recommend Post</title><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M6.633 10.5c.806 0 1.533-.446 2.031-1.08a9.041 9.041 0 0 1 2.861-2.4c.723-.384 1.35-.956 1.653-1.715a4.498 4.498 0 0 0 .322-1.672V3a.75.75 0 0 1 .75-.75A2.25 2.25 0 0 1 16.5 4.5c0 1.152-.26 2.243-.723 3.218c-.266.558.107 1.282.725 1.282h3.126c1.026 0 1.945.694 2.054 1.715c.045.422.068.85.068 1.285a11.95 11.95 0 0 1-2.649 7.521c-.388.482-.987.729-1.605.729H13.48a4.53 4.53 0 0 1-1.423-.23l-3.114-1.04a4.501 4.501 0 0 0-1.423-.23H5.904M14.25 9h2.25M5.904 18.75c.083.205.173.405.27.602c.197.4-.078.898-.523.898h-.908c-.889 0-1.713-.518-1.972-1.368a12 12 0 0 1-.521-3.507c0-1.553.295-3.036.831-4.398C3.387 10.203 4.167 9.75 5 9.75h1.053c.472 0 .745.556.5.96a8.958 8.958 0 0 0-1.302 4.665a8.97 8.97 0 0 0 .654 3.375Z"/></svg>
<svg v-else class="text-gray-700 w-8 h-8" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><title>Unrecommend</title><path fill="currentColor" d="M7.493 18.75c-.425 0-.82-.236-.975-.632A7.48 7.48 0 0 1 6 15.375a7.47 7.47 0 0 1 1.602-4.634c.151-.192.373-.309.6-.397c.473-.183.89-.514 1.212-.924a9.042 9.042 0 0 1 2.861-2.4c.723-.384 1.35-.956 1.653-1.715a4.498 4.498 0 0 0 .322-1.672V3a.75.75 0 0 1 .75-.75a2.25 2.25 0 0 1 2.25 2.25c0 1.152-.26 2.243-.723 3.218c-.266.558.107 1.282.725 1.282h3.126c1.026 0 1.945.694 2.054 1.715c.045.422.068.85.068 1.285a11.95 11.95 0 0 1-2.649 7.521c-.388.482-.987.729-1.605.729H14.23a4.53 4.53 0 0 1-1.423-.23l-3.114-1.04a4.501 4.501 0 0 0-1.423-.23h-.777Zm-5.162-7.773a11.969 11.969 0 0 0-.831 4.398a12 12 0 0 0 .52 3.507c.26.85 1.084 1.368 1.973 1.368H4.9c.445 0 .72-.498.523-.898a8.963 8.963 0 0 1-.924-3.977c0-1.708.476-3.305 1.302-4.666c.245-.403-.028-.959-.5-.959H4.25c-.832 0-1.612.453-1.918 1.227Z"/></svg>
Expand Down Expand Up @@ -1251,15 +1273,17 @@ export const PostComments = {
<ThreadDialogs :show="show" :comment-id="showTarget?.id" @done="show=''" @showDialog="show=$event" />
</div>
`,
props: ['commentLink'],
props: ['hide','commentLink'],
setup(props) {
/** @type {Store} */
const store = inject('store')
const client = useClient()
const { user } = useAuth()
const { asStrings } = useUtils()
const instance = getCurrentInstance()
store.config.commentLink = props.commentLink

const hide = computed(() => asStrings(props.hide))
let comments = ref([])
let show = ref('')
let showTarget = ref(null)
Expand Down Expand Up @@ -1318,6 +1342,7 @@ export const PostComments = {

return {
store,
hide,
threadId,
comments,
toggleLike,
Expand Down
Loading

0 comments on commit 34f43f3

Please sign in to comment.