<commit_before><template>
<div>
	<mk-container :show-header="!props.compact">
		<template #header><fa :icon="faStickyNote"/>{{ $t('_widgets.memo') }}</template>

		<div class="otgbylcu">
			<textarea v-model="text" :placeholder="$t('placeholder')" @input="onChange"></textarea>
			<button @click="saveMemo" :disabled="!changed">{{ $t('save') }}</button>
		</div>
	</mk-container>
</div>
</template>

<script lang="ts">
import { faStickyNote } from '@fortawesome/free-solid-svg-icons';
import MkContainer from '../components/ui/container.vue';
import define from './define';
import i18n from '../i18n';

export default define({
	name: 'memo',
	props: () => ({
		compact: false
	})
}).extend({
	i18n,
	
	components: {
		MkContainer
	},

	data() {
		return {
			text: null,
			changed: false,
			timeoutId: null,
			faStickyNote
		};
	},

	created() {
		this.text = this.$store.state.settings.memo;

		this.$watch('$store.state.settings.memo', text => {
			this.text = text;
		});
	},

	methods: {
		func() {
			this.props.compact = !this.props.compact;
			this.save();
		},

		onChange() {
			this.changed = true;
			clearTimeout(this.timeoutId);
			this.timeoutId = setTimeout(this.saveMemo, 1000);
		},

		saveMemo() {
			this.$store.dispatch('settings/set', {
				key: 'memo',
				value: this.text
			});
			this.changed = false;
		}
	}
});
</script>

<style lang="scss" scoped>
.otgbylcu {
	padding-bottom: 28px + 16px;

	> textarea {
		display: block;
		width: 100%;
		max-width: 100%;
		min-width: 100%;
		padding: 16px;
		color: var(--inputText);
		background: var(--face);
		border: none;
		border-bottom: solid var(--lineWidth) var(--faceDivider);
		border-radius: 0;
	}

	> button {
		display: block;
		position: absolute;
		bottom: 8px;
		right: 8px;
		margin: 0;
		padding: 0 10px;
		height: 28px;
		color: #fff;
		background: var(--accent) !important;
		outline: none;
		border: none;
		border-radius: 4px;
		transition: background 0.1s ease;
		cursor: pointer;

		&:hover {
			background: var(--accentLighten10) !important;
		}

		&:active {
			background: var(--accentDarken) !important;
			transition: background 0s ease;
		}

		&:disabled {
			opacity: 0.7;
			cursor: default;
		}
	}
}
</style><commit_msg>:art:<commit_after><template>
<div>
	<mk-container :show-header="!props.compact">
		<template #header><fa :icon="faStickyNote"/>{{ $t('_widgets.memo') }}</template>

		<div class="otgbylcu">
			<textarea v-model="text" :placeholder="$t('placeholder')" @input="onChange"></textarea>
			<button @click="saveMemo" :disabled="!changed" class="_buttonPrimary">{{ $t('save') }}</button>
		</div>
	</mk-container>
</div>
</template>

<script lang="ts">
import { faStickyNote } from '@fortawesome/free-solid-svg-icons';
import MkContainer from '../components/ui/container.vue';
import define from './define';
import i18n from '../i18n';

export default define({
	name: 'memo',
	props: () => ({
		compact: false
	})
}).extend({
	i18n,
	
	components: {
		MkContainer
	},

	data() {
		return {
			text: null,
			changed: false,
			timeoutId: null,
			faStickyNote
		};
	},

	created() {
		this.text = this.$store.state.settings.memo;

		this.$watch('$store.state.settings.memo', text => {
			this.text = text;
		});
	},

	methods: {
		func() {
			this.props.compact = !this.props.compact;
			this.save();
		},

		onChange() {
			this.changed = true;
			clearTimeout(this.timeoutId);
			this.timeoutId = setTimeout(this.saveMemo, 1000);
		},

		saveMemo() {
			this.$store.dispatch('settings/set', {
				key: 'memo',
				value: this.text
			});
			this.changed = false;
		}
	}
});
</script>

<style lang="scss" scoped>
.otgbylcu {
	padding-bottom: 28px + 16px;

	> textarea {
		display: block;
		width: 100%;
		max-width: 100%;
		min-width: 100%;
		padding: 16px;
		color: var(--inputText);
		background: var(--face);
		border: none;
		border-bottom: solid var(--lineWidth) var(--faceDivider);
		border-radius: 0;
		box-sizing: border-box;
	}

	> button {
		display: block;
		position: absolute;
		bottom: 8px;
		right: 8px;
		margin: 0;
		padding: 0 10px;
		height: 28px;
		outline: none;
		border-radius: 4px;

		&:disabled {
			opacity: 0.7;
			cursor: default;
		}
	}
}
</style>
{'fraction_non_alphanumeric': 0.18893129770992367, 'fraction_numerical': 0.018845419847328244, 'mean_word_length': 3.4941050375133975, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 49, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6786395', 'n_tokens_mistral': 1837, 'n_tokens_neox': 1555, 'n_words': 321}