update inbox list
This commit is contained in:
55
vendor/laravel/ui/src/Presets/Bootstrap.php
vendored
Normal file
55
vendor/laravel/ui/src/Presets/Bootstrap.php
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
namespace Laravel\Ui\Presets;
|
||||
|
||||
class Bootstrap extends Preset
|
||||
{
|
||||
/**
|
||||
* Install the preset.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function install()
|
||||
{
|
||||
static::updatePackages();
|
||||
static::updateSass();
|
||||
static::updateBootstrapping();
|
||||
static::removeNodeModules();
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the given package array.
|
||||
*
|
||||
* @param array $packages
|
||||
* @return array
|
||||
*/
|
||||
protected static function updatePackageArray(array $packages)
|
||||
{
|
||||
return [
|
||||
'bootstrap' => '^4.0.0',
|
||||
'jquery' => '^3.2',
|
||||
'popper.js' => '^1.12',
|
||||
] + $packages;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the Sass files for the application.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected static function updateSass()
|
||||
{
|
||||
copy(__DIR__.'/bootstrap-stubs/_variables.scss', resource_path('sass/_variables.scss'));
|
||||
copy(__DIR__.'/bootstrap-stubs/app.scss', resource_path('sass/app.scss'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the bootstrapping files.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected static function updateBootstrapping()
|
||||
{
|
||||
copy(__DIR__.'/bootstrap-stubs/bootstrap.js', resource_path('js/bootstrap.js'));
|
||||
}
|
||||
}
|
||||
65
vendor/laravel/ui/src/Presets/Preset.php
vendored
Normal file
65
vendor/laravel/ui/src/Presets/Preset.php
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
namespace Laravel\Ui\Presets;
|
||||
|
||||
use Illuminate\Filesystem\Filesystem;
|
||||
|
||||
class Preset
|
||||
{
|
||||
/**
|
||||
* Ensure the component directories we need exist.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected static function ensureComponentDirectoryExists()
|
||||
{
|
||||
$filesystem = new Filesystem;
|
||||
|
||||
if (! $filesystem->isDirectory($directory = resource_path('js/components'))) {
|
||||
$filesystem->makeDirectory($directory, 0755, true);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the "package.json" file.
|
||||
*
|
||||
* @param bool $dev
|
||||
* @return void
|
||||
*/
|
||||
protected static function updatePackages($dev = true)
|
||||
{
|
||||
if (! file_exists(base_path('package.json'))) {
|
||||
return;
|
||||
}
|
||||
|
||||
$configurationKey = $dev ? 'devDependencies' : 'dependencies';
|
||||
|
||||
$packages = json_decode(file_get_contents(base_path('package.json')), true);
|
||||
|
||||
$packages[$configurationKey] = static::updatePackageArray(
|
||||
array_key_exists($configurationKey, $packages) ? $packages[$configurationKey] : [],
|
||||
$configurationKey
|
||||
);
|
||||
|
||||
ksort($packages[$configurationKey]);
|
||||
|
||||
file_put_contents(
|
||||
base_path('package.json'),
|
||||
json_encode($packages, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT).PHP_EOL
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the installed Node modules.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected static function removeNodeModules()
|
||||
{
|
||||
tap(new Filesystem, function ($files) {
|
||||
$files->deleteDirectory(base_path('node_modules'));
|
||||
|
||||
$files->delete(base_path('yarn.lock'));
|
||||
});
|
||||
}
|
||||
}
|
||||
76
vendor/laravel/ui/src/Presets/React.php
vendored
Normal file
76
vendor/laravel/ui/src/Presets/React.php
vendored
Normal file
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
|
||||
namespace Laravel\Ui\Presets;
|
||||
|
||||
use Illuminate\Filesystem\Filesystem;
|
||||
use Illuminate\Support\Arr;
|
||||
|
||||
class React extends Preset
|
||||
{
|
||||
/**
|
||||
* Install the preset.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function install()
|
||||
{
|
||||
static::ensureComponentDirectoryExists();
|
||||
static::updatePackages();
|
||||
static::updateWebpackConfiguration();
|
||||
static::updateBootstrapping();
|
||||
static::updateComponent();
|
||||
static::removeNodeModules();
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the given package array.
|
||||
*
|
||||
* @param array $packages
|
||||
* @return array
|
||||
*/
|
||||
protected static function updatePackageArray(array $packages)
|
||||
{
|
||||
return [
|
||||
'@babel/preset-react' => '^7.0.0',
|
||||
'react' => '^16.2.0',
|
||||
'react-dom' => '^16.2.0',
|
||||
] + Arr::except($packages, ['vue', 'vue-template-compiler']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the Webpack configuration.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected static function updateWebpackConfiguration()
|
||||
{
|
||||
copy(__DIR__.'/react-stubs/webpack.mix.js', base_path('webpack.mix.js'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the example component.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected static function updateComponent()
|
||||
{
|
||||
(new Filesystem)->delete(
|
||||
resource_path('js/components/ExampleComponent.vue')
|
||||
);
|
||||
|
||||
copy(
|
||||
__DIR__.'/react-stubs/Example.js',
|
||||
resource_path('js/components/Example.js')
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the bootstrapping files.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected static function updateBootstrapping()
|
||||
{
|
||||
copy(__DIR__.'/react-stubs/app.js', resource_path('js/app.js'));
|
||||
}
|
||||
}
|
||||
82
vendor/laravel/ui/src/Presets/Vue.php
vendored
Normal file
82
vendor/laravel/ui/src/Presets/Vue.php
vendored
Normal file
@@ -0,0 +1,82 @@
|
||||
<?php
|
||||
|
||||
namespace Laravel\Ui\Presets;
|
||||
|
||||
use Illuminate\Filesystem\Filesystem;
|
||||
use Illuminate\Support\Arr;
|
||||
|
||||
class Vue extends Preset
|
||||
{
|
||||
/**
|
||||
* Install the preset.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function install()
|
||||
{
|
||||
static::ensureComponentDirectoryExists();
|
||||
static::updatePackages();
|
||||
static::updateWebpackConfiguration();
|
||||
static::updateBootstrapping();
|
||||
static::updateComponent();
|
||||
static::removeNodeModules();
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the given package array.
|
||||
*
|
||||
* @param array $packages
|
||||
* @return array
|
||||
*/
|
||||
protected static function updatePackageArray(array $packages)
|
||||
{
|
||||
return [
|
||||
'resolve-url-loader' => '^2.3.1',
|
||||
'sass' => '^1.20.1',
|
||||
'sass-loader' => '^8.0.0',
|
||||
'vue' => '^2.5.17',
|
||||
'vue-template-compiler' => '^2.6.10',
|
||||
] + Arr::except($packages, [
|
||||
'@babel/preset-react',
|
||||
'react',
|
||||
'react-dom',
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the Webpack configuration.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected static function updateWebpackConfiguration()
|
||||
{
|
||||
copy(__DIR__.'/vue-stubs/webpack.mix.js', base_path('webpack.mix.js'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the example component.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected static function updateComponent()
|
||||
{
|
||||
(new Filesystem)->delete(
|
||||
resource_path('js/components/Example.js')
|
||||
);
|
||||
|
||||
copy(
|
||||
__DIR__.'/vue-stubs/ExampleComponent.vue',
|
||||
resource_path('js/components/ExampleComponent.vue')
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the bootstrapping files.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected static function updateBootstrapping()
|
||||
{
|
||||
copy(__DIR__.'/vue-stubs/app.js', resource_path('js/app.js'));
|
||||
}
|
||||
}
|
||||
19
vendor/laravel/ui/src/Presets/bootstrap-stubs/_variables.scss
vendored
Normal file
19
vendor/laravel/ui/src/Presets/bootstrap-stubs/_variables.scss
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
// Body
|
||||
$body-bg: #f8fafc;
|
||||
|
||||
// Typography
|
||||
$font-family-sans-serif: 'Nunito', sans-serif;
|
||||
$font-size-base: 0.9rem;
|
||||
$line-height-base: 1.6;
|
||||
|
||||
// Colors
|
||||
$blue: #3490dc;
|
||||
$indigo: #6574cd;
|
||||
$purple: #9561e2;
|
||||
$pink: #f66d9b;
|
||||
$red: #e3342f;
|
||||
$orange: #f6993f;
|
||||
$yellow: #ffed4a;
|
||||
$green: #38c172;
|
||||
$teal: #4dc0b5;
|
||||
$cyan: #6cb2eb;
|
||||
8
vendor/laravel/ui/src/Presets/bootstrap-stubs/app.scss
vendored
Normal file
8
vendor/laravel/ui/src/Presets/bootstrap-stubs/app.scss
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
// Fonts
|
||||
@import url('https://fonts.googleapis.com/css?family=Nunito');
|
||||
|
||||
// Variables
|
||||
@import 'variables';
|
||||
|
||||
// Bootstrap
|
||||
@import '~bootstrap/scss/bootstrap';
|
||||
41
vendor/laravel/ui/src/Presets/bootstrap-stubs/bootstrap.js
vendored
Normal file
41
vendor/laravel/ui/src/Presets/bootstrap-stubs/bootstrap.js
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
window._ = require('lodash');
|
||||
|
||||
/**
|
||||
* We'll load jQuery and the Bootstrap jQuery plugin which provides support
|
||||
* for JavaScript based Bootstrap features such as modals and tabs. This
|
||||
* code may be modified to fit the specific needs of your application.
|
||||
*/
|
||||
|
||||
try {
|
||||
window.Popper = require('popper.js').default;
|
||||
window.$ = window.jQuery = require('jquery');
|
||||
|
||||
require('bootstrap');
|
||||
} catch (e) {}
|
||||
|
||||
/**
|
||||
* We'll load the axios HTTP library which allows us to easily issue requests
|
||||
* to our Laravel back-end. This library automatically handles sending the
|
||||
* CSRF token as a header based on the value of the "XSRF" token cookie.
|
||||
*/
|
||||
|
||||
window.axios = require('axios');
|
||||
|
||||
window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
|
||||
|
||||
/**
|
||||
* Echo exposes an expressive API for subscribing to channels and listening
|
||||
* for events that are broadcast by Laravel. Echo and event broadcasting
|
||||
* allows your team to easily build robust real-time web applications.
|
||||
*/
|
||||
|
||||
// import Echo from 'laravel-echo';
|
||||
|
||||
// window.Pusher = require('pusher-js');
|
||||
|
||||
// window.Echo = new Echo({
|
||||
// broadcaster: 'pusher',
|
||||
// key: process.env.MIX_PUSHER_APP_KEY,
|
||||
// cluster: process.env.MIX_PUSHER_APP_CLUSTER,
|
||||
// forceTLS: true
|
||||
// });
|
||||
24
vendor/laravel/ui/src/Presets/react-stubs/Example.js
vendored
Normal file
24
vendor/laravel/ui/src/Presets/react-stubs/Example.js
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
|
||||
function Example() {
|
||||
return (
|
||||
<div className="container">
|
||||
<div className="row justify-content-center">
|
||||
<div className="col-md-8">
|
||||
<div className="card">
|
||||
<div className="card-header">Example Component</div>
|
||||
|
||||
<div className="card-body">I'm an example component!</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default Example;
|
||||
|
||||
if (document.getElementById('example')) {
|
||||
ReactDOM.render(<Example />, document.getElementById('example'));
|
||||
}
|
||||
15
vendor/laravel/ui/src/Presets/react-stubs/app.js
vendored
Normal file
15
vendor/laravel/ui/src/Presets/react-stubs/app.js
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* First we will load all of this project's JavaScript dependencies which
|
||||
* includes React and other helpers. It's a great starting point while
|
||||
* building robust, powerful web applications using React + Laravel.
|
||||
*/
|
||||
|
||||
require('./bootstrap');
|
||||
|
||||
/**
|
||||
* Next, we will create a fresh React component instance and attach it to
|
||||
* the page. Then, you may begin adding components to this application
|
||||
* or customize the JavaScript scaffolding to fit your unique needs.
|
||||
*/
|
||||
|
||||
require('./components/Example');
|
||||
15
vendor/laravel/ui/src/Presets/react-stubs/webpack.mix.js
vendored
Normal file
15
vendor/laravel/ui/src/Presets/react-stubs/webpack.mix.js
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
const mix = require('laravel-mix');
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Mix Asset Management
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Mix provides a clean, fluent API for defining some Webpack build steps
|
||||
| for your Laravel application. By default, we are compiling the Sass
|
||||
| file for the application as well as bundling up all the JS files.
|
||||
|
|
||||
*/
|
||||
|
||||
mix.react('resources/js/app.js', 'public/js')
|
||||
.sass('resources/sass/app.scss', 'public/css');
|
||||
23
vendor/laravel/ui/src/Presets/vue-stubs/ExampleComponent.vue
vendored
Normal file
23
vendor/laravel/ui/src/Presets/vue-stubs/ExampleComponent.vue
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
<template>
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<div class="card">
|
||||
<div class="card-header">Example Component</div>
|
||||
|
||||
<div class="card-body">
|
||||
I'm an example component.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
mounted() {
|
||||
console.log('Component mounted.')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
32
vendor/laravel/ui/src/Presets/vue-stubs/app.js
vendored
Normal file
32
vendor/laravel/ui/src/Presets/vue-stubs/app.js
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
/**
|
||||
* First we will load all of this project's JavaScript dependencies which
|
||||
* includes Vue and other libraries. It is a great starting point when
|
||||
* building robust, powerful web applications using Vue and Laravel.
|
||||
*/
|
||||
|
||||
require('./bootstrap');
|
||||
|
||||
window.Vue = require('vue');
|
||||
|
||||
/**
|
||||
* The following block of code may be used to automatically register your
|
||||
* Vue components. It will recursively scan this directory for the Vue
|
||||
* components and automatically register them with their "basename".
|
||||
*
|
||||
* Eg. ./components/ExampleComponent.vue -> <example-component></example-component>
|
||||
*/
|
||||
|
||||
// const files = require.context('./', true, /\.vue$/i)
|
||||
// files.keys().map(key => Vue.component(key.split('/').pop().split('.')[0], files(key).default))
|
||||
|
||||
Vue.component('example-component', require('./components/ExampleComponent.vue').default);
|
||||
|
||||
/**
|
||||
* Next, we will create a fresh Vue application instance and attach it to
|
||||
* the page. Then, you may begin adding components to this application
|
||||
* or customize the JavaScript scaffolding to fit your unique needs.
|
||||
*/
|
||||
|
||||
const app = new Vue({
|
||||
el: '#app',
|
||||
});
|
||||
15
vendor/laravel/ui/src/Presets/vue-stubs/webpack.mix.js
vendored
Normal file
15
vendor/laravel/ui/src/Presets/vue-stubs/webpack.mix.js
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
const mix = require('laravel-mix');
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Mix Asset Management
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Mix provides a clean, fluent API for defining some Webpack build steps
|
||||
| for your Laravel application. By default, we are compiling the Sass
|
||||
| file for the application as well as bundling up all the JS files.
|
||||
|
|
||||
*/
|
||||
|
||||
mix.js('resources/js/app.js', 'public/js')
|
||||
.sass('resources/sass/app.scss', 'public/css');
|
||||
Reference in New Issue
Block a user