@@ -398,6 +398,8 @@ export default {
398398
399399 mounted () {
400400 this .mode = this .getPreference (' mode' ) || ' table' ;
401+
402+ this .addToCommandPalette ();
401403 },
402404
403405 watch: {
@@ -683,6 +685,72 @@ export default {
683685 uploadsUpdated (uploads ) {
684686 this .uploads = uploads;
685687 },
688+
689+ addToCommandPalette () {
690+ Statamic .$commandPalette .add ({
691+ when : () => this .canCreateContainers ,
692+ category: Statamic .$commandPalette .category .Actions ,
693+ text: __ (' Upload' ),
694+ icon: ' upload' ,
695+ action : () => this .openFileBrowser (),
696+ prioritize: true ,
697+ });
698+
699+ Statamic .$commandPalette .add ({
700+ when : () => this .canCreateContainers ,
701+ category: Statamic .$commandPalette .category .Actions ,
702+ text: __ (' Create Folder' ),
703+ icon: ' folder-add' ,
704+ action : () => this .startCreatingFolder (),
705+ });
706+
707+ Statamic .$commandPalette .add ({
708+ category: Statamic .$commandPalette .category .Actions ,
709+ text: __ (' Toggle Grid Layout' ),
710+ icon: ' layout-grid' ,
711+ when : () => this .mode === ' table' ,
712+ action : () => this .mode = ' grid' ,
713+ });
714+
715+ Statamic .$commandPalette .add ({
716+ category: Statamic .$commandPalette .category .Actions ,
717+ text: __ (' Toggle List Layout' ),
718+ icon: ' layout-list' ,
719+ when : () => this .mode === ' grid' ,
720+ action : () => this .mode = ' table' ,
721+ });
722+
723+ Statamic .$commandPalette .add ({
724+ when : () => this .canCreateContainers ,
725+ category: Statamic .$commandPalette .category .Actions ,
726+ text: __ (' Create Container' ),
727+ icon: ' container-add' ,
728+ url: this .createContainerUrl ,
729+ });
730+
731+ Statamic .$commandPalette .add ({
732+ when : () => this .container .can_edit ,
733+ category: Statamic .$commandPalette .category .Actions ,
734+ text: __ (' Configure Container' ),
735+ icon: ' cog' ,
736+ url: this .container .edit_url ,
737+ });
738+
739+ Statamic .$commandPalette .add ({
740+ category: Statamic .$commandPalette .category .Actions ,
741+ text: __ (' Edit Blueprint' ),
742+ icon: ' blueprint-edit' ,
743+ url: this .container .blueprint_url ,
744+ });
745+
746+ Statamic .$commandPalette .add ({
747+ when : () => this .container .can_delete ,
748+ category: Statamic .$commandPalette .category .Actions ,
749+ text: __ (' Delete Container' ),
750+ icon: ' trash' ,
751+ action : () => this .$refs .deleter .confirm (),
752+ });
753+ }
686754 },
687755};
688756< / script>
0 commit comments