Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,120 changes: 1,553 additions & 567 deletions package-lock.json

Large diffs are not rendered by default.

15 changes: 6 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,13 @@
"build": "vite build"
},
"dependencies": {
"axios": "^1.12.0",
"cross-env": "^7.0.2",
"marked": "^14.1.3",
"underscore": "^1.13.7",
"uniqid": "^5.4.0",
"vue": "^2.6.11"
"@tailwindcss/vite": "^4.1.16",
"tailwindcss": "^4.1.16",
"uniqid": "^5.4.0"
},
"devDependencies": {
"@vitejs/plugin-vue2": "^2.2.0",
"laravel-vite-plugin": "^0.7.4",
"vite": "^4.5.9"
"@statamic/cms": "file:./vendor/statamic/cms/resources/dist-package",
"laravel-vite-plugin": "^1.3.0",
"vite": "^6.4.1"
}
}
11 changes: 11 additions & 0 deletions resources/css/cp.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@import "@statamic/cms/tailwind.css";

@source "../js";

/**
Borders & padding will be added by the individual destination fields.
We don't want them on the parent destination fieldtype. It just acts as a container.
*/
.import_destination-fieldtype {
@apply border-b-0 !px-0 !py-0;
}
88 changes: 0 additions & 88 deletions resources/js/components/CreateImportForm.vue

This file was deleted.

145 changes: 0 additions & 145 deletions resources/js/components/EditImportForm.vue

This file was deleted.

111 changes: 49 additions & 62 deletions resources/js/components/Fieldtypes/BlueprintFieldtype.vue
Original file line number Diff line number Diff line change
@@ -1,63 +1,50 @@
<template>
<v-select
searchable
:options="options"
:get-option-label="(option) => option.title"
:get-option-key="(option) => option.handle"
:value="value"
:reduce="opt => opt.handle"
@input="update($event)"
/>
</template>

<script>
export default {
mixins: [Fieldtype],

inject: ['storeName'],

mounted() {
if (! this.value && this.type && (this.collection || this.taxonomy)) {
this.$emit('input', this.options[0].handle);
}
},

computed: {
type() {
return this.$store.state.publish[this.storeName].values.destination.type;
},

collection() {
return this.$store.state.publish[this.storeName].values.destination.collection[0];
},

taxonomy() {
return this.$store.state.publish[this.storeName].values.destination.taxonomy[0];
},

options() {
if (this.type === 'entries') {
return this.meta.collectionBlueprints[this.collection];
}

if (this.type === 'terms') {
return this.meta.taxonomyBlueprints[this.taxonomy];
}
},
},

watch: {
type() {
this.$emit('input', null);
},

collection() {
this.$emit('input', this.options[0].handle);
},

taxonomy() {
this.$emit('input', this.options[0].handle);
},
}
}
<script setup>
import { Fieldtype } from '@statamic/cms';
import { injectPublishContext, Select } from '@statamic/cms/ui';
import { computed, watch, onMounted } from 'vue';

const { values: publishValues } = injectPublishContext();

const emit = defineEmits(Fieldtype.emits);
const props = defineProps(Fieldtype.props);
const { expose, update } = Fieldtype.use(emit, props);
defineExpose(expose);

const type = computed(() => publishValues.value.destination?.type);
const collection = computed(() => publishValues.value.destination?.collection[0]);
const taxonomy = computed(() => publishValues.value.destination?.taxonomy[0]);

const options = computed(() => {
if (type.value === 'entries') {
return props.meta.collectionBlueprints[collection.value] ?? [];
}

if (type.value === 'terms') {
return props.meta.taxonomyBlueprints[taxonomy.value] ?? [];
}

return [];
});

watch(() => type.value, () => update(null));
watch(() => collection.value, () => update(options.value[0].handle));
watch(() => taxonomy.value, () => update(options.value[0].handle));

onMounted(() => {
if (! props.value && type.value && (collection.value || taxonomy.value)) {
update(options.value[0].handle);
}
});
</script>

<template>
<Select
v-if="options.length > 0"
class="w-full"
:options
option-label="title"
option-value="handle"
:model-value="value"
@update:model-value="update($event)"
/>
</template>
Loading
Loading