Merge branch 'develop' of https://firefish.dev/firefish/firefish into style/mkpostform

This commit is contained in:
Lhcfl 2024-05-22 10:49:43 +08:00
commit 9d87794ed5
23 changed files with 236 additions and 274 deletions

12
Cargo.lock generated
View file

@ -436,9 +436,9 @@ dependencies = [
[[package]]
name = "built"
version = "0.7.2"
version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "41bfbdb21256b87a8b5e80fab81a8eed158178e812fd7ba451907518b2742f16"
checksum = "c6a6c0b39c38fd754ac338b00a88066436389c0f029da5d37d1e01091d9b7c17"
[[package]]
name = "bumpalo"
@ -649,9 +649,9 @@ checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5"
[[package]]
name = "crc32fast"
version = "1.4.0"
version = "1.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa"
checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3"
dependencies = [
"cfg-if",
]
@ -2088,9 +2088,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf"
[[package]]
name = "openssl-src"
version = "300.2.3+3.2.1"
version = "300.3.0+3.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5cff92b6f71555b61bb9315f7c64da3ca43d87531622120fea0195fc761b4843"
checksum = "eba8804a1c5765b18c4b3f907e6897ebabeedebc9830e1a0046c4a4cf44663e1"
dependencies = [
"cc",
]

View file

@ -36,8 +36,8 @@
"adm-zip": "0.5.10",
"ajv": "8.13.0",
"archiver": "7.0.1",
"aws-sdk": "2.1624.0",
"axios": "1.7.1",
"aws-sdk": "2.1625.0",
"axios": "1.7.2",
"backend-rs": "workspace:*",
"blurhash": "2.0.5",
"bull": "4.12.7",

View file

@ -54,15 +54,6 @@
><i :class="icon('ph-eye-slash')"></i
></span>
</button>
<!-- <button
v-if="editId == null"
v-tooltip="i18n.ts.scheduledPost"
class="_button schedule"
:class="{ active: scheduledAt }"
@click="setScheduledAt"
>
<i :class="icon('ph-clock')"></i>
</button> -->
<button
ref="languageButton"
v-tooltip="i18n.ts.language"
@ -263,28 +254,12 @@
>
<i :class="icon('ph-smiley')"></i>
</button>
<!-- <button
v-if="postFormActions.length > 0"
v-tooltip="i18n.ts.plugin"
class="_button"
@click="showActions"
>
<i :class="icon('ph-plug')"></i>
</button> -->
<!-- v-if="showMfmCheatsheet" -->
<!-- <button
v-tooltip="i18n.ts._mfm.cheatSheet"
class="_button right"
@click="openCheatSheet"
>
<i :class="icon('ph-question')"></i>
</button> -->
<button
v-tooltip="i18n.ts.other"
v-tooltip="i18n.ts.more"
class="_button right"
@click="openMoreActionsMenu"
@click="showMoreMenu"
>
<i :class="icon('ph-dots-three-circle')"></i>
<i :class="icon('ph-dots-three-outline')"></i>
</button>
<div v-if="showBigPostButton">
<button
@ -573,7 +548,7 @@ if (
(props.reply.user.host != null && props.reply.user.host !== host))
) {
text.value = `@${props.reply.user.username}${
props.reply.user.host != null ? "@" + toASCII(props.reply.user.host) : ""
props.reply.user.host != null ? `@${toASCII(props.reply.user.host)}` : ""
} `;
}
@ -802,7 +777,7 @@ function setVisibility() {
);
}
async function setScheduledAt() {
async function setSchedule() {
function getDateStr(type: "date" | "time", value: number) {
const tmp = document.createElement("input");
tmp.type = type;
@ -1342,32 +1317,11 @@ async function insertEmoji(ev: MouseEvent) {
);
}
async function openCheatSheet(ev: MouseEvent) {
async function openCheatSheet(_ev: MouseEvent) {
os.popup(XCheatSheet, {}, {}, "closed");
}
function showActions(ev: MouseEvent) {
os.popupMenu(
postFormActions.map((action) => ({
text: action.title,
action: () => {
action.handler(
{
text: text.value,
},
(key, value) => {
if (key === "text") {
text.value = value;
}
},
);
},
})),
(ev.currentTarget ?? ev.target) as HTMLElement,
);
}
function openMoreActionsMenu(ev: MouseEvent) {
function showMoreMenu(ev: MouseEvent) {
const pluginMenu: MenuItem[] = postFormActions.map((action) => ({
text: action.title,
icon: icon("ph-plug"),
@ -1388,7 +1342,7 @@ function openMoreActionsMenu(ev: MouseEvent) {
{
text: i18n.ts.scheduledPost,
icon: icon("ph-clock"),
action: setScheduledAt,
action: setSchedule,
},
scheduledAt.value != null
? {
@ -1411,9 +1365,31 @@ function openMoreActionsMenu(ev: MouseEvent) {
},
...(pluginMenu.length > 0 ? [null, ...pluginMenu] : []),
];
os.popupMenu(menu, (ev.currentTarget ?? ev.target) as HTMLElement);
}
// function showActions(ev: MouseEvent) {
// os.popupMenu(
// postFormActions.map((action) => ({
// text: action.title,
// action: () => {
// action.handler(
// {
// text: text.value,
// },
// (key, value) => {
// if (key === "text") {
// text.value = value;
// }
// },
// );
// },
// })),
// (ev.currentTarget ?? ev.target) as HTMLElement,
// );
// }
const postAccount = ref<entities.UserDetailed | null>(null);
function openAccountMenu(ev: MouseEvent) {
@ -1551,14 +1527,6 @@ onMounted(() => {
display: flex;
align-items: center;
> .schedule {
width: 34px;
height: 34px;
&.active {
color: var(--accent);
}
}
> .text-count {
opacity: 0.7;
line-height: 66px;
@ -1764,7 +1732,7 @@ onMounted(() => {
}
}
&.max-width_500px {
&.max-width_500px, &.widget {
> header {
height: 50px;
@ -1801,17 +1769,11 @@ onMounted(() => {
> footer {
padding: 0 8px 8px 8px;
}
}
}
&.max-width_310px {
> .form {
> footer {
> button {
font-size: 14px;
width: 44px;
height: 44px;
width: 42px;
height: 42px;
}
}
}

View file

@ -51,9 +51,7 @@ const props = defineProps<{
];
}>();
const emit = defineEmits<{
(ev: "closed"): void;
}>();
const emit = defineEmits<(ev: "closed") => void>();
const modal = shallowRef<InstanceType<typeof MkModal>>();
const form = shallowRef<InstanceType<typeof MkPostForm>>();

View file

@ -28,7 +28,7 @@ const parentStickyTop = inject<Ref<number>>(CURRENT_STICKY_TOP, ref(0));
provide(CURRENT_STICKY_TOP, childStickyTop);
const calc = () => {
childStickyTop.value = parentStickyTop.value + headerEl.value!.offsetHeight;
childStickyTop.value = parentStickyTop.value + (headerEl.value?.offsetHeight ?? 0);
headerHeight.value = headerEl.value!.offsetHeight.toString();
};

View file

@ -45,7 +45,11 @@
<script lang="ts" setup>
import { ref } from "vue";
import type { Widget, WidgetComponentExpose } from "./widget";
import type {
WidgetComponentExpose,
WidgetComponentProps,
WidgetComponentEmits,
} from "./widget";
import { useWidgetPropsManager } from "./widget";
import type { GetFormResultType } from "@/scripts/form";
import { i18n } from "@/i18n";
@ -63,11 +67,8 @@ const widgetPropsDef = {
type WidgetProps = GetFormResultType<typeof widgetPropsDef>;
// vueimporttype
// const props = defineProps<WidgetComponentProps<WidgetProps>>();
// const emit = defineEmits<WidgetComponentEmits<WidgetProps>>();
const props = defineProps<{ widget?: Widget<WidgetProps> }>();
const emit = defineEmits<{ (ev: "updateProps", props: WidgetProps) }>();
const props = defineProps<WidgetComponentProps<WidgetProps>>();
const emit = defineEmits<WidgetComponentEmits<WidgetProps>>();
const { widgetProps, configure } = useWidgetPropsManager(
name,

View file

@ -48,7 +48,11 @@
<script lang="ts" setup>
import { computed } from "vue";
import type { Widget, WidgetComponentExpose } from "./widget";
import type {
WidgetComponentExpose,
WidgetComponentProps,
WidgetComponentEmits,
} from "./widget";
import { useWidgetPropsManager } from "./widget";
import type { GetFormResultType } from "@/scripts/form";
import MkContainer from "@/components/MkContainer.vue";
@ -184,11 +188,8 @@ const widgetPropsDef = {
type WidgetProps = GetFormResultType<typeof widgetPropsDef>;
// vueimporttype
// const props = defineProps<WidgetComponentProps<WidgetProps>>();
// const emit = defineEmits<WidgetComponentEmits<WidgetProps>>();
const props = defineProps<{ widget?: Widget<WidgetProps> }>();
const emit = defineEmits<{ (ev: "updateProps", props: WidgetProps) }>();
const props = defineProps<WidgetComponentProps<WidgetProps>>();
const emit = defineEmits<WidgetComponentEmits<WidgetProps>>();
const { widgetProps, configure } = useWidgetPropsManager(
name,

View file

@ -16,12 +16,12 @@
<script lang="ts" setup>
import { computed } from "vue";
import type { Widget, WidgetComponentExpose } from "./widget";
import {
WidgetComponentEmits,
import type {
WidgetComponentExpose,
WidgetComponentProps,
useWidgetPropsManager,
WidgetComponentEmits,
} from "./widget";
import { useWidgetPropsManager } from "./widget";
import type { GetFormResultType } from "@/scripts/form";
import { timezones } from "@/scripts/timezones";
import MkDigitalClock from "@/components/MkDigitalClock.vue";
@ -64,11 +64,8 @@ const widgetPropsDef = {
type WidgetProps = GetFormResultType<typeof widgetPropsDef>;
// vueimporttype
// const props = defineProps<WidgetComponentProps<WidgetProps>>();
// const emit = defineEmits<WidgetComponentEmits<WidgetProps>>();
const props = defineProps<{ widget?: Widget<WidgetProps> }>();
const emit = defineEmits<{ (ev: "updateProps", props: WidgetProps) }>();
const props = defineProps<WidgetComponentProps<WidgetProps>>();
const emit = defineEmits<WidgetComponentEmits<WidgetProps>>();
const { widgetProps, configure } = useWidgetPropsManager(
name,

View file

@ -45,7 +45,11 @@
<script lang="ts" setup>
import { ref } from "vue";
import type { Widget, WidgetComponentExpose } from "./widget";
import type {
WidgetComponentExpose,
WidgetComponentProps,
WidgetComponentEmits,
} from "./widget";
import { useWidgetPropsManager } from "./widget";
import type { GetFormResultType } from "@/scripts/form";
import MkContainer from "@/components/MkContainer.vue";
@ -67,15 +71,13 @@ const widgetPropsDef = {
type WidgetProps = GetFormResultType<typeof widgetPropsDef>;
// vueimporttype
// const props = defineProps<WidgetComponentProps<WidgetProps> & { foldable?: boolean; scrollable?: boolean; }>();
// const emit = defineEmits<WidgetComponentEmits<WidgetProps>>();
const props = defineProps<{
widget?: Widget<WidgetProps>;
const props = defineProps<
WidgetComponentProps<WidgetProps> & {
foldable?: boolean;
scrollable?: boolean;
}>();
const emit = defineEmits<{ (ev: "updateProps", props: WidgetProps) }>();
}
>();
const emit = defineEmits<WidgetComponentEmits<WidgetProps>>();
const { widgetProps, configure } = useWidgetPropsManager(
name,

View file

@ -23,7 +23,11 @@
import { ref, shallowRef } from "vue";
import { useWidgetPropsManager } from "./widget";
import type { Widget, WidgetComponentExpose } from "./widget";
import type {
WidgetComponentExpose,
WidgetComponentProps,
WidgetComponentEmits,
} from "./widget";
import type { GetFormResultType } from "@/scripts/form";
import MkContainer from "@/components/MkContainer.vue";
import MkTagCloud from "@/components/MkTagCloud.vue";
@ -42,11 +46,8 @@ const widgetPropsDef = {
type WidgetProps = GetFormResultType<typeof widgetPropsDef>;
// vueimporttype
// const props = defineProps<WidgetComponentProps<WidgetProps>>();
// const emit = defineEmits<WidgetComponentEmits<WidgetProps>>();
const props = defineProps<{ widget?: Widget<WidgetProps> }>();
const emit = defineEmits<{ (ev: "updateProps", props: WidgetProps) }>();
const props = defineProps<WidgetComponentProps<WidgetProps>>();
const emit = defineEmits<WidgetComponentEmits<WidgetProps>>();
const { widgetProps, configure } = useWidgetPropsManager(
name,

View file

@ -124,7 +124,11 @@
<script lang="ts" setup>
import { onUnmounted, reactive } from "vue";
import type { Widget, WidgetComponentExpose } from "./widget";
import type {
WidgetComponentExpose,
WidgetComponentProps,
WidgetComponentEmits,
} from "./widget";
import { useWidgetPropsManager } from "./widget";
import type { GetFormResultType } from "@/scripts/form";
import { useStream } from "@/stream";
@ -148,11 +152,8 @@ const widgetPropsDef = {
type WidgetProps = GetFormResultType<typeof widgetPropsDef>;
// vueimporttype
// const props = defineProps<WidgetComponentProps<WidgetProps>>();
// const emit = defineEmits<WidgetComponentEmits<WidgetProps>>();
const props = defineProps<{ widget?: Widget<WidgetProps> }>();
const emit = defineEmits<{ (ev: "updateProps", props: WidgetProps) }>();
const props = defineProps<WidgetComponentProps<WidgetProps>>();
const emit = defineEmits<WidgetComponentEmits<WidgetProps>>();
const { widgetProps, configure } = useWidgetPropsManager(
name,

View file

@ -31,7 +31,11 @@
<script lang="ts" setup>
import { defineAsyncComponent } from "vue";
import type { Widget, WidgetComponentExpose } from "./widget";
import type {
WidgetComponentExpose,
WidgetComponentProps,
WidgetComponentEmits,
} from "./widget";
import { useWidgetPropsManager } from "./widget";
import type { GetFormResultType } from "@/scripts/form";
import MkContainer from "@/components/MkContainer.vue";
@ -60,11 +64,8 @@ const widgetPropsDef = {
type WidgetProps = GetFormResultType<typeof widgetPropsDef>;
// vueimporttype
// const props = defineProps<WidgetComponentProps<WidgetProps>>();
// const emit = defineEmits<WidgetComponentEmits<WidgetProps>>();
const props = defineProps<{ widget?: Widget<WidgetProps> }>();
const emit = defineEmits<{ (ev: "updateProps", props: WidgetProps) }>();
const props = defineProps<WidgetComponentProps<WidgetProps>>();
const emit = defineEmits<WidgetComponentEmits<WidgetProps>>();
const { widgetProps, configure, save } = useWidgetPropsManager(
name,

View file

@ -21,7 +21,11 @@
<script lang="ts" setup>
import { ref } from "vue";
import type { Widget, WidgetComponentExpose } from "./widget";
import type {
WidgetComponentExpose,
WidgetComponentProps,
WidgetComponentEmits,
} from "./widget";
import { useWidgetPropsManager } from "./widget";
import type { GetFormResultType } from "@/scripts/form";
import * as os from "@/os";
@ -39,11 +43,8 @@ const widgetPropsDef = {
type WidgetProps = GetFormResultType<typeof widgetPropsDef>;
// vueimporttype
// const props = defineProps<WidgetComponentProps<WidgetProps>>();
// const emit = defineEmits<WidgetComponentEmits<WidgetProps>>();
const props = defineProps<{ widget?: Widget<WidgetProps> }>();
const emit = defineEmits<{ (ev: "updateProps", props: WidgetProps) }>();
const props = defineProps<WidgetComponentProps<WidgetProps>>();
const emit = defineEmits<WidgetComponentEmits<WidgetProps>>();
const { widgetProps, configure } = useWidgetPropsManager(
name,

View file

@ -27,7 +27,11 @@
<script lang="ts" setup>
import { onUnmounted, ref } from "vue";
import type { Widget, WidgetComponentExpose } from "./widget";
import type {
WidgetComponentExpose,
WidgetComponentProps,
WidgetComponentEmits,
} from "./widget";
import { useWidgetPropsManager } from "./widget";
import type { GetFormResultType } from "@/scripts/form";
import { useStream } from "@/stream";
@ -53,11 +57,8 @@ const widgetPropsDef = {
type WidgetProps = GetFormResultType<typeof widgetPropsDef>;
// vueimporttype
// const props = defineProps<WidgetComponentProps<WidgetProps>>();
// const emit = defineEmits<WidgetComponentEmits<WidgetProps>>();
const props = defineProps<{ widget?: Widget<WidgetProps> }>();
const emit = defineEmits<{ (ev: "updateProps", props: WidgetProps) }>();
const props = defineProps<WidgetComponentProps<WidgetProps>>();
const emit = defineEmits<WidgetComponentEmits<WidgetProps>>();
const { widgetProps, configure } = useWidgetPropsManager(
name,

View file

@ -8,7 +8,11 @@
</template>
<script lang="ts" setup>
import type { Widget, WidgetComponentExpose } from "./widget";
import type {
WidgetComponentExpose,
WidgetComponentProps,
WidgetComponentEmits,
} from "./widget";
import { useWidgetPropsManager } from "./widget";
import type { GetFormResultType } from "@/scripts/form";
import XPostForm from "@/components/MkPostForm.vue";
@ -19,11 +23,8 @@ const widgetPropsDef = {};
type WidgetProps = GetFormResultType<typeof widgetPropsDef>;
// vueimporttype
// const props = defineProps<WidgetComponentProps<WidgetProps>>();
// const emit = defineEmits<WidgetComponentEmits<WidgetProps>>();
const props = defineProps<{ widget?: Widget<WidgetProps> }>();
const emit = defineEmits<{ (ev: "updateProps", props: WidgetProps) }>();
const props = defineProps<WidgetComponentProps<WidgetProps>>();
const emit = defineEmits<WidgetComponentEmits<WidgetProps>>();
const { widgetProps, configure } = useWidgetPropsManager(
name,

View file

@ -38,7 +38,11 @@
<script lang="ts" setup>
import { ref, watch } from "vue";
import type { Widget, WidgetComponentExpose } from "./widget";
import type {
WidgetComponentExpose,
WidgetComponentProps,
WidgetComponentEmits,
} from "./widget";
import { useWidgetPropsManager } from "./widget";
import MarqueeText from "@/components/MkMarquee.vue";
import type { GetFormResultType } from "@/scripts/form";
@ -85,11 +89,8 @@ const widgetPropsDef = {
type WidgetProps = GetFormResultType<typeof widgetPropsDef>;
// vueimporttype
// const props = defineProps<WidgetComponentProps<WidgetProps>>();
// const emit = defineEmits<WidgetComponentEmits<WidgetProps>>();
const props = defineProps<{ widget?: Widget<WidgetProps> }>();
const emit = defineEmits<{ (ev: "updateProps", props: WidgetProps) }>();
const props = defineProps<WidgetComponentProps<WidgetProps>>();
const emit = defineEmits<WidgetComponentEmits<WidgetProps>>();
const { widgetProps, configure } = useWidgetPropsManager(
name,

View file

@ -30,7 +30,11 @@
<script lang="ts" setup>
import { ref, watch } from "vue";
import type { Widget, WidgetComponentExpose } from "./widget";
import type {
WidgetComponentExpose,
WidgetComponentProps,
WidgetComponentEmits,
} from "./widget";
import { useWidgetPropsManager } from "./widget";
import type { GetFormResultType } from "@/scripts/form";
import MkContainer from "@/components/MkContainer.vue";
@ -56,11 +60,8 @@ const widgetPropsDef = {
type WidgetProps = GetFormResultType<typeof widgetPropsDef>;
// vueimporttype
// const props = defineProps<WidgetComponentProps<WidgetProps>>();
// const emit = defineEmits<WidgetComponentEmits<WidgetProps>>();
const props = defineProps<{ widget?: Widget<WidgetProps> }>();
const emit = defineEmits<{ (ev: "updateProps", props: WidgetProps) }>();
const props = defineProps<WidgetComponentProps<WidgetProps>>();
const emit = defineEmits<WidgetComponentEmits<WidgetProps>>();
const { widgetProps, configure } = useWidgetPropsManager(
name,

View file

@ -24,7 +24,11 @@
<script lang="ts" setup>
import { onMounted, ref } from "vue";
import type { Widget, WidgetComponentExpose } from "./widget";
import type {
WidgetComponentExpose,
WidgetComponentProps,
WidgetComponentEmits,
} from "./widget";
import { useWidgetPropsManager } from "./widget";
import type { GetFormResultType } from "@/scripts/form";
import * as os from "@/os";
@ -47,11 +51,8 @@ const widgetPropsDef = {
type WidgetProps = GetFormResultType<typeof widgetPropsDef>;
// vueimporttype
// const props = defineProps<WidgetComponentProps<WidgetProps>>();
// const emit = defineEmits<WidgetComponentEmits<WidgetProps>>();
const props = defineProps<{ widget?: Widget<WidgetProps> }>();
const emit = defineEmits<{ (ev: "updateProps", props: WidgetProps) }>();
const props = defineProps<WidgetComponentProps<WidgetProps>>();
const emit = defineEmits<WidgetComponentEmits<WidgetProps>>();
const { widgetProps, configure, save } = useWidgetPropsManager(
name,

View file

@ -70,7 +70,11 @@
<script lang="ts" setup>
import { ref } from "vue";
import type { Widget, WidgetComponentExpose } from "./widget";
import type {
WidgetComponentExpose,
WidgetComponentProps,
WidgetComponentEmits,
} from "./widget";
import { useWidgetPropsManager } from "./widget";
import type { GetFormResultType } from "@/scripts/form";
import * as os from "@/os";
@ -109,11 +113,8 @@ const widgetPropsDef = {
type WidgetProps = GetFormResultType<typeof widgetPropsDef>;
// vueimporttype
// const props = defineProps<WidgetComponentProps<WidgetProps>>();
// const emit = defineEmits<WidgetComponentEmits<WidgetProps>>();
const props = defineProps<{ widget?: Widget<WidgetProps> }>();
const emit = defineEmits<{ (ev: "updateProps", props: WidgetProps) }>();
const props = defineProps<WidgetComponentProps<WidgetProps>>();
const emit = defineEmits<WidgetComponentEmits<WidgetProps>>();
const { widgetProps, configure, save } = useWidgetPropsManager(
name,

View file

@ -38,7 +38,11 @@
<script lang="ts" setup>
import { ref } from "vue";
import type { Widget, WidgetComponentExpose } from "./widget";
import type {
WidgetComponentExpose,
WidgetComponentProps,
WidgetComponentEmits,
} from "./widget";
import { useWidgetPropsManager } from "./widget";
import type { GetFormResultType } from "@/scripts/form";
import MkContainer from "@/components/MkContainer.vue";
@ -60,11 +64,8 @@ const widgetPropsDef = {
type WidgetProps = GetFormResultType<typeof widgetPropsDef>;
// vueimporttype
// const props = defineProps<WidgetComponentProps<WidgetProps>>();
// const emit = defineEmits<WidgetComponentEmits<WidgetProps>>();
const props = defineProps<{ widget?: Widget<WidgetProps> }>();
const emit = defineEmits<{ (ev: "updateProps", props: WidgetProps) }>();
const props = defineProps<WidgetComponentProps<WidgetProps>>();
const emit = defineEmits<WidgetComponentEmits<WidgetProps>>();
const { widgetProps, configure } = useWidgetPropsManager(
name,

View file

@ -18,7 +18,11 @@
<script lang="ts" setup>
import { onUnmounted, ref, watch } from "vue";
import type { Widget, WidgetComponentExpose } from "./widget";
import type {
WidgetComponentExpose,
WidgetComponentProps,
WidgetComponentEmits,
} from "./widget";
import { useWidgetPropsManager } from "./widget";
import type { GetFormResultType } from "@/scripts/form";
@ -46,11 +50,8 @@ const widgetPropsDef = {
type WidgetProps = GetFormResultType<typeof widgetPropsDef>;
// vueimporttype
// const props = defineProps<WidgetComponentProps<WidgetProps>>();
// const emit = defineEmits<WidgetComponentEmits<WidgetProps>>();
const props = defineProps<{ widget?: Widget<WidgetProps> }>();
const emit = defineEmits<{ (ev: "updateProps", props: WidgetProps) }>();
const props = defineProps<WidgetComponentProps<WidgetProps>>();
const emit = defineEmits<WidgetComponentEmits<WidgetProps>>();
const { widgetProps, configure } = useWidgetPropsManager(
name,

View file

@ -30,7 +30,11 @@
<script lang="ts" setup>
import { ref } from "vue";
import type { Widget, WidgetComponentExpose } from "./widget";
import type {
WidgetComponentExpose,
WidgetComponentProps,
WidgetComponentEmits,
} from "./widget";
import { useWidgetPropsManager } from "./widget";
import type { GetFormResultType } from "@/scripts/form";
import MkContainer from "@/components/MkContainer.vue";
@ -54,11 +58,10 @@ const widgetPropsDef = {
},
};
type WidgetProps = GetFormResultType<typeof widgetPropsDef>;
// vueimporttype
// const props = defineProps<WidgetComponentProps<WidgetProps>>();
// const emit = defineEmits<WidgetComponentEmits<WidgetProps>>();
const props = defineProps<{ widget?: Widget<WidgetProps> }>();
const emit = defineEmits<{ (ev: "updateProps", props: WidgetProps) }>();
const props = defineProps<WidgetComponentProps<WidgetProps>>();
const emit = defineEmits<WidgetComponentEmits<WidgetProps>>();
const { widgetProps, configure, save } = useWidgetPropsManager(
name,
widgetPropsDef,

View file

@ -85,11 +85,11 @@ importers:
specifier: 7.0.1
version: 7.0.1
aws-sdk:
specifier: 2.1624.0
version: 2.1624.0
specifier: 2.1625.0
version: 2.1625.0
axios:
specifier: 1.7.1
version: 1.7.1
specifier: 1.7.2
version: 1.7.2
backend-rs:
specifier: workspace:*
version: link:../backend-rs
@ -916,7 +916,7 @@ importers:
version: 4.17.21
ts-jest:
specifier: ^29.0.5
version: 29.1.2(@babel/core@7.24.5)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.24.5))(jest@29.7.0(@types/node@18.11.18)(ts-node@10.9.2(@types/node@18.11.18)(typescript@4.9.4)))(typescript@4.9.4)
version: 29.1.3(@babel/core@7.24.5)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.24.5))(jest@29.7.0(@types/node@18.11.18)(ts-node@10.9.2(@types/node@18.11.18)(typescript@4.9.4)))(typescript@4.9.4)
typedoc:
specifier: ^0.23.24
version: 0.23.28(typescript@4.9.4)
@ -2673,8 +2673,8 @@ packages:
resolution: {integrity: sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg==}
engines: {node: ^16.0.0 || >=18.0.0}
'@typescript-eslint/types@7.9.0':
resolution: {integrity: sha512-oZQD9HEWQanl9UfsbGVcZ2cGaR0YT5476xfWE0oE5kQa2sNK2frxOlkeacLOTh9po4AlUT5rtkGyYM5kew0z5w==}
'@typescript-eslint/types@7.10.0':
resolution: {integrity: sha512-7fNj+Ya35aNyhuqrA1E/VayQX9Elwr8NKZ4WueClR3KwJ7Xx9jcCdOrLW04h51de/+gNbyFMs+IDxh5xIwfbNg==}
engines: {node: ^18.18.0 || >=20.0.0}
'@typescript-eslint/typescript-estree@5.62.0':
@ -3030,8 +3030,8 @@ packages:
resolution: {integrity: sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==}
engines: {node: '>= 0.4'}
aws-sdk@2.1624.0:
resolution: {integrity: sha512-SxBGDkdmsQTXLKPaY+hLqjlQyZBaGaFD34EhTd4aYuuqT952sxYeDt7w75py4o4O5z4hUUTccqTF9dtpxCPJfg==}
aws-sdk@2.1625.0:
resolution: {integrity: sha512-Q96jKdo9PtBYPNOXoGTYvOt78TSRouLOeeFpcVfsN38O0Lc3LmuIMz3GHMofdLZGKRSa22RnpiDTCnpp6Xx1jw==}
engines: {node: '>= 10.0.0'}
axios@0.24.0:
@ -3040,8 +3040,8 @@ packages:
axios@1.2.2:
resolution: {integrity: sha512-bz/J4gS2S3I7mpN/YZfGFTqhXTYzRho8Ay38w2otuuDR322KzFIWm/4W2K6gIwvWaws5n+mnb7D1lN9uD+QH6Q==}
axios@1.7.1:
resolution: {integrity: sha512-+LV37nQcd1EpFalkXksWNBiA17NZ5m5/WspmHGmZmdx1qBOg/VNq/c4eRJiA9VQQHBOs+N0ZhhdU10h2TyNK7Q==}
axios@1.7.2:
resolution: {integrity: sha512-2A8QhOMrbomlDuiLeK9XibIBzuHeRcqqNOHp0Cyp5EoJ1IFDh+XZH3A6BkXtv0K4gFGCI0Y4BM7B1wOEi0Rmgw==}
b4a@1.6.6:
resolution: {integrity: sha512-5Tk1HLk6b6ctmjIkAcU/Ujv/1WqiDl0F0JdRCR80VsOcUlHcu7pWeWRlOqQLHfDEsVx9YH/aif5AG4ehoCtTmg==}
@ -3127,8 +3127,8 @@ packages:
brace-expansion@2.0.1:
resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==}
braces@3.0.2:
resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==}
braces@3.0.3:
resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==}
engines: {node: '>=8'}
broadcast-channel@7.0.0:
@ -3998,8 +3998,8 @@ packages:
engines: {node: '>=0.10.0'}
hasBin: true
electron-to-chromium@1.4.774:
resolution: {integrity: sha512-132O1XCd7zcTkzS3FgkAzKmnBuNJjK8WjcTtNuoylj7MYbqw5eXehjQ5OK91g0zm7OTKIPeaAG4CPoRfD9M1Mg==}
electron-to-chromium@1.4.777:
resolution: {integrity: sha512-n02NCwLJ3wexLfK/yQeqfywCblZqLcXphzmid5e8yVPdtEcida7li0A5WQKghHNG0FeOMCzeFOzEbtAh5riXFw==}
emittery@0.13.1:
resolution: {integrity: sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==}
@ -4566,8 +4566,8 @@ packages:
resolution: {integrity: sha512-M45CbrJLGACfrPOkrTp3j2EcO9OBkKUYME0eiqOCa7i2poaklU0jhlIaMlr8ijLorT0uLAzrn3qXOp5684CkfA==}
engines: {node: '>=12.20'}
fill-range@7.0.1:
resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==}
fill-range@7.1.1:
resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==}
engines: {node: '>=8'}
find-up@4.1.0:
@ -4750,8 +4750,8 @@ packages:
glob-to-regexp@0.4.1:
resolution: {integrity: sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==}
glob@10.3.15:
resolution: {integrity: sha512-0c6RlJt1TICLyvJYIApxb8GsXoai0KUP7AxKKAtsYXdgJR1mGEUa7DgwShbdk1nly0PYoZj01xd4hzbq3fsjpw==}
glob@10.3.16:
resolution: {integrity: sha512-JDKXl1DiuuHJ6fVS2FXjownaavciiHNUU4mOvV/B793RLh05vZL1rcPnCSaOgv1hDT6RDlY7AB7ZUvFYAtPgAw==}
engines: {node: '>=16 || 14 >=14.18'}
hasBin: true
@ -5263,8 +5263,8 @@ packages:
resolution: {integrity: sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==}
engines: {node: '>=8'}
jackspeak@2.3.6:
resolution: {integrity: sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ==}
jackspeak@3.1.2:
resolution: {integrity: sha512-kWmLKn2tRtfYMF/BakihVVRzBKOxz4gJMiL2Rj91WnAB5TPZumSH99R/Yf1qE1u4uRimvCSJfm6hnxohXeEXjQ==}
engines: {node: '>=14'}
jake@10.9.1:
@ -5850,8 +5850,8 @@ packages:
micromark@2.11.4:
resolution: {integrity: sha512-+WoovN/ppKolQOFIAajxi7Lu9kInbPxFuTBVEavFcL8eAfVstoc5MocPmqBeAdBOJV00uaVjegzH4+MA0DN/uA==}
micromatch@4.0.5:
resolution: {integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==}
micromatch@4.0.6:
resolution: {integrity: sha512-Y4Ypn3oujJYxJcMacVgcs92wofTHxp9FzfDpQON4msDefoC0lb3ETvQLOdLcbhSwU1bz8HrL/1sygfBIHudrkQ==}
engines: {node: '>=8.6'}
mime-db@1.52.0:
@ -6361,6 +6361,10 @@ packages:
resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==}
engines: {node: '>=8.6'}
picomatch@4.0.2:
resolution: {integrity: sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==}
engines: {node: '>=12'}
pify@2.3.0:
resolution: {integrity: sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==}
engines: {node: '>=0.10.0'}
@ -6385,8 +6389,8 @@ packages:
resolution: {integrity: sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==}
engines: {node: '>= 6'}
piscina@4.4.0:
resolution: {integrity: sha512-+AQduEJefrOApE4bV7KRmp3N2JnnyErlVqq4P/jmko4FPz9Z877BCccl/iB3FdrWSUkvbGV9Kan/KllJgat3Vg==}
piscina@4.5.0:
resolution: {integrity: sha512-iBaLWI56PFP81cfBSomWTmhOo9W2/yhIOL+Tk8O1vBCpK39cM0tGxB+wgYjG31qq4ohGvysfXSdnj8h7g4rZxA==}
pkg-dir@4.2.0:
resolution: {integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==}
@ -7380,27 +7384,6 @@ packages:
peerDependencies:
typescript: '>=4.2.0'
ts-jest@29.1.2:
resolution: {integrity: sha512-br6GJoH/WUX4pu7FbZXuWGKGNDuU7b8Uj77g/Sp7puZV6EXzuByl6JrECvm0MzVzSTkSHWTihsXt+5XYER5b+g==}
engines: {node: ^16.10.0 || ^18.0.0 || >=20.0.0}
hasBin: true
peerDependencies:
'@babel/core': '>=7.0.0-beta.0 <8'
'@jest/types': ^29.0.0
babel-jest: ^29.0.0
esbuild: '*'
jest: ^29.0.0
typescript: '>=4.3 <6'
peerDependenciesMeta:
'@babel/core':
optional: true
'@jest/types':
optional: true
babel-jest:
optional: true
esbuild:
optional: true
ts-jest@29.1.3:
resolution: {integrity: sha512-6L9qz3ginTd1NKhOxmkP0qU3FyKjj5CPoY+anszfVn6Pmv/RIKzhiMCsH7Yb7UvJR9I2A64rm4zQl531s2F1iw==}
engines: {node: ^14.15.0 || ^16.10.0 || ^18.0.0 || >=20.0.0}
@ -8522,7 +8505,7 @@ snapshots:
dependencies:
'@types/eslint': 8.56.10
'@types/estree': 1.0.5
'@typescript-eslint/types': 7.9.0
'@typescript-eslint/types': 7.10.0
comment-parser: 1.4.1
esquery: 1.5.0
jsdoc-type-pratt-parser: 4.0.0
@ -8935,7 +8918,7 @@ snapshots:
jest-util: 29.7.0
jest-validate: 29.7.0
jest-watcher: 29.7.0
micromatch: 4.0.5
micromatch: 4.0.6
pretty-format: 29.7.0
slash: 3.0.0
strip-ansi: 6.0.1
@ -8970,7 +8953,7 @@ snapshots:
jest-util: 29.7.0
jest-validate: 29.7.0
jest-watcher: 29.7.0
micromatch: 4.0.5
micromatch: 4.0.6
pretty-format: 29.7.0
slash: 3.0.0
strip-ansi: 6.0.1
@ -9081,7 +9064,7 @@ snapshots:
jest-haste-map: 29.7.0
jest-regex-util: 29.6.3
jest-util: 29.7.0
micromatch: 4.0.5
micromatch: 4.0.6
pirates: 4.0.6
slash: 3.0.0
write-file-atomic: 4.0.2
@ -9413,7 +9396,7 @@ snapshots:
commander: 8.3.0
fast-glob: 3.3.2
minimatch: 9.0.4
piscina: 4.4.0
piscina: 4.5.0
semver: 7.6.2
slash: 3.0.0
source-map: 0.7.4
@ -10015,7 +9998,7 @@ snapshots:
'@typescript-eslint/types@6.21.0': {}
'@typescript-eslint/types@7.9.0': {}
'@typescript-eslint/types@7.10.0': {}
'@typescript-eslint/typescript-estree@5.62.0(typescript@4.9.4)':
dependencies:
@ -10383,7 +10366,7 @@ snapshots:
archiver-utils@5.0.2:
dependencies:
glob: 10.3.15
glob: 10.3.16
graceful-fs: 4.2.11
is-stream: 2.0.1
lazystream: 1.0.1
@ -10491,7 +10474,7 @@ snapshots:
dependencies:
possible-typed-array-names: 1.0.0
aws-sdk@2.1624.0:
aws-sdk@2.1625.0:
dependencies:
buffer: 4.9.2
events: 1.1.1
@ -10518,7 +10501,7 @@ snapshots:
transitivePeerDependencies:
- debug
axios@1.7.1:
axios@1.7.2:
dependencies:
follow-redirects: 1.15.6
form-data: 4.0.0
@ -10641,9 +10624,9 @@ snapshots:
dependencies:
balanced-match: 1.0.2
braces@3.0.2:
braces@3.0.3:
dependencies:
fill-range: 7.0.1
fill-range: 7.1.1
broadcast-channel@7.0.0:
dependencies:
@ -10661,7 +10644,7 @@ snapshots:
browserslist@4.23.0:
dependencies:
caniuse-lite: 1.0.30001620
electron-to-chromium: 1.4.774
electron-to-chromium: 1.4.777
node-releases: 2.0.14
update-browserslist-db: 1.0.16(browserslist@4.23.0)
@ -10691,7 +10674,7 @@ snapshots:
buffer@4.9.2:
dependencies:
base64-js: 1.5.1
ieee754: 1.2.1
ieee754: 1.1.13
isarray: 1.0.0
buffer@5.7.1:
@ -10872,7 +10855,7 @@ snapshots:
chokidar@3.5.3:
dependencies:
anymatch: 3.1.3
braces: 3.0.2
braces: 3.0.3
glob-parent: 5.1.2
is-binary-path: 2.1.0
is-glob: 4.0.3
@ -10884,7 +10867,7 @@ snapshots:
chokidar@3.6.0:
dependencies:
anymatch: 3.1.3
braces: 3.0.2
braces: 3.0.3
glob-parent: 5.1.2
is-binary-path: 2.1.0
is-glob: 4.0.3
@ -11301,7 +11284,7 @@ snapshots:
deepl-node@1.13.0:
dependencies:
'@types/node': 20.12.12
axios: 1.7.1
axios: 1.7.2
form-data: 3.0.1
loglevel: 1.9.1
transitivePeerDependencies:
@ -11440,7 +11423,7 @@ snapshots:
dependencies:
jake: 10.9.1
electron-to-chromium@1.4.774: {}
electron-to-chromium@1.4.777: {}
emittery@0.13.1: {}
@ -12234,7 +12217,7 @@ snapshots:
'@nodelib/fs.walk': 1.2.8
glob-parent: 5.1.2
merge2: 1.4.1
micromatch: 4.0.5
micromatch: 4.0.6
fast-json-stable-stringify@2.1.0: {}
@ -12307,7 +12290,7 @@ snapshots:
strip-outer: 2.0.0
trim-repeated: 2.0.0
fill-range@7.0.1:
fill-range@7.1.1:
dependencies:
to-regex-range: 5.0.1
@ -12494,10 +12477,10 @@ snapshots:
glob-to-regexp@0.4.1: {}
glob@10.3.15:
glob@10.3.16:
dependencies:
foreground-child: 3.1.1
jackspeak: 2.3.6
jackspeak: 3.1.2
minimatch: 9.0.4
minipass: 7.1.1
path-scurry: 1.11.1
@ -13024,7 +13007,7 @@ snapshots:
html-escaper: 2.0.2
istanbul-lib-report: 3.0.1
jackspeak@2.3.6:
jackspeak@3.1.2:
dependencies:
'@isaacs/cliui': 8.0.2
optionalDependencies:
@ -13126,7 +13109,7 @@ snapshots:
jest-runner: 29.7.0
jest-util: 29.7.0
jest-validate: 29.7.0
micromatch: 4.0.5
micromatch: 4.0.6
parse-json: 5.2.0
pretty-format: 29.7.0
slash: 3.0.0
@ -13157,7 +13140,7 @@ snapshots:
jest-runner: 29.7.0
jest-util: 29.7.0
jest-validate: 29.7.0
micromatch: 4.0.5
micromatch: 4.0.6
parse-json: 5.2.0
pretty-format: 29.7.0
slash: 3.0.0
@ -13188,7 +13171,7 @@ snapshots:
jest-runner: 29.7.0
jest-util: 29.7.0
jest-validate: 29.7.0
micromatch: 4.0.5
micromatch: 4.0.6
parse-json: 5.2.0
pretty-format: 29.7.0
slash: 3.0.0
@ -13248,7 +13231,7 @@ snapshots:
jest-regex-util: 29.6.3
jest-util: 29.7.0
jest-worker: 29.7.0
micromatch: 4.0.5
micromatch: 4.0.6
walker: 1.0.8
optionalDependencies:
fsevents: 2.3.3
@ -13272,7 +13255,7 @@ snapshots:
'@types/stack-utils': 2.0.3
chalk: 4.1.2
graceful-fs: 4.2.11
micromatch: 4.0.5
micromatch: 4.0.6
pretty-format: 29.7.0
slash: 3.0.0
stack-utils: 2.0.6
@ -13467,7 +13450,7 @@ snapshots:
dependencies:
config-chain: 1.1.13
editorconfig: 1.0.4
glob: 10.3.15
glob: 10.3.16
js-cookie: 3.0.5
nopt: 7.2.1
@ -14003,10 +13986,10 @@ snapshots:
transitivePeerDependencies:
- supports-color
micromatch@4.0.5:
micromatch@4.0.6:
dependencies:
braces: 3.0.2
picomatch: 2.3.1
braces: 3.0.3
picomatch: 4.0.2
mime-db@1.52.0: {}
@ -14505,6 +14488,8 @@ snapshots:
picomatch@2.3.1: {}
picomatch@4.0.2: {}
pify@2.3.0: {}
pify@3.0.0: {}
@ -14519,7 +14504,7 @@ snapshots:
pirates@4.0.6: {}
piscina@4.4.0:
piscina@4.5.0:
optionalDependencies:
nice-napi: 1.0.2
@ -15606,7 +15591,7 @@ snapshots:
dependencies:
typescript: 5.4.5
ts-jest@29.1.2(@babel/core@7.24.5)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.24.5))(jest@29.7.0(@types/node@18.11.18)(ts-node@10.9.2(@types/node@18.11.18)(typescript@4.9.4)))(typescript@4.9.4):
ts-jest@29.1.3(@babel/core@7.24.5)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.24.5))(jest@29.7.0(@types/node@18.11.18)(ts-node@10.9.2(@types/node@18.11.18)(typescript@4.9.4)))(typescript@4.9.4):
dependencies:
bs-logger: 0.2.6
fast-json-stable-stringify: 2.1.0
@ -15620,6 +15605,7 @@ snapshots:
yargs-parser: 21.1.1
optionalDependencies:
'@babel/core': 7.24.5
'@jest/transform': 29.7.0
'@jest/types': 29.6.3
babel-jest: 29.7.0(@babel/core@7.24.5)
@ -15645,7 +15631,7 @@ snapshots:
dependencies:
chalk: 4.1.2
enhanced-resolve: 5.16.1
micromatch: 4.0.5
micromatch: 4.0.6
semver: 7.6.2
source-map: 0.7.4
typescript: 5.4.5
@ -15813,7 +15799,7 @@ snapshots:
dayjs: 1.11.11
debug: 4.3.4(supports-color@8.1.1)
dotenv: 16.4.5
glob: 10.3.15
glob: 10.3.16
mkdirp: 2.1.6
reflect-metadata: 0.2.2
sha.js: 2.4.11
@ -16186,7 +16172,7 @@ snapshots:
xml2js@0.6.2:
dependencies:
sax: 1.3.0
sax: 1.2.1
xmlbuilder: 11.0.1
xmlbuilder@11.0.1: {}