This commit is contained in:
syuilo 2025-06-03 07:44:35 +09:00
parent 5342b024b2
commit c701016989
4 changed files with 6 additions and 8 deletions

View File

@ -38,7 +38,6 @@ SPDX-License-Identifier: AGPL-3.0-only
<script setup lang="ts">
import { ref, useTemplateRef, watch, onMounted, onUnmounted } from 'vue';
import { v4 as uuid } from 'uuid';
import type { ImageEffectorLayer } from '@/utility/image-effector/ImageEffector.js';
import { i18n } from '@/i18n.js';
import { ImageEffector } from '@/utility/image-effector/ImageEffector.js';

View File

@ -49,7 +49,6 @@ SPDX-License-Identifier: AGPL-3.0-only
<script setup lang="ts">
import { ref, useTemplateRef, watch, onMounted, onUnmounted, reactive, nextTick } from 'vue';
import { v4 as uuid } from 'uuid';
import type { ImageEffectorLayer } from '@/utility/image-effector/ImageEffector.js';
import { i18n } from '@/i18n.js';
import { ImageEffector } from '@/utility/image-effector/ImageEffector.js';
@ -61,6 +60,7 @@ import XLayer from '@/components/MkImageEffectorDialog.Layer.vue';
import * as os from '@/os.js';
import { deepClone } from '@/utility/clone.js';
import { FXS } from '@/utility/image-effector/fxs.js';
import { genId } from '@/utility/id.js';
const props = defineProps<{
image: File;
@ -99,7 +99,7 @@ function addEffect(ev: MouseEvent) {
text: fx.name,
action: () => {
layers.push({
id: uuid(),
id: genId(),
fxId: fx.id,
params: Object.fromEntries(Object.entries(fx.params).map(([k, v]) => [k, v.default])),
});

View File

@ -90,7 +90,6 @@ SPDX-License-Identifier: AGPL-3.0-only
<script setup lang="ts">
import { ref, useTemplateRef, watch, onMounted, onUnmounted } from 'vue';
import { v4 as uuid } from 'uuid';
import type { ImageEffectorLayer } from '@/utility/image-effector/ImageEffector.js';
import type { WatermarkPreset } from '@/utility/watermark.js';
import { i18n } from '@/i18n.js';

View File

@ -71,7 +71,6 @@ SPDX-License-Identifier: AGPL-3.0-only
<script setup lang="ts">
import { ref, useTemplateRef, watch, onMounted, onUnmounted, reactive, nextTick } from 'vue';
import { v4 as uuid } from 'uuid';
import type { WatermarkPreset } from '@/utility/watermark.js';
import { WatermarkRenderer } from '@/utility/watermark.js';
import { i18n } from '@/i18n.js';
@ -83,12 +82,13 @@ import XLayer from '@/components/MkWatermarkEditorDialog.Layer.vue';
import * as os from '@/os.js';
import { deepClone } from '@/utility/clone.js';
import { ensureSignin } from '@/i.js';
import { genId } from '@/utility/id.js';
const $i = ensureSignin();
function createTextLayer(): WatermarkPreset['layers'][number] {
return {
id: uuid(),
id: genId(),
type: 'text',
text: `(c) @${$i.username}`,
align: { x: 'right', y: 'bottom' },
@ -100,7 +100,7 @@ function createTextLayer(): WatermarkPreset['layers'][number] {
function createImageLayer(): WatermarkPreset['layers'][number] {
return {
id: uuid(),
id: genId(),
type: 'image',
imageId: null,
imageUrl: null,
@ -118,7 +118,7 @@ const props = defineProps<{
}>();
const preset = reactive<WatermarkPreset>(deepClone(props.preset) ?? {
id: uuid(),
id: genId(),
name: '',
layers: [createTextLayer()],
});