Skip to content

Commit

Permalink
Merge branch '3.x' into fix/console-error-on-forms-with-permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
haringsrob authored Nov 7, 2022
2 parents 0b3bad9 + 42c1808 commit 9d1e0a3
Show file tree
Hide file tree
Showing 323 changed files with 5,783 additions and 24,835 deletions.
9 changes: 9 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/tests export-ignore
/phpunit.xml export-ignore
/.github export-ignore
/phpstan.neon export-ignore
/phpstan-baseline.neon export-ignore
/phpcs.xml export-ignore
/docs export-ignore
/docs-api export-ignore
/examples/tests-* export-ignore
11 changes: 6 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:

- name: Install dependencies
run: |
composer require "laravel/framework:8.*" "doctrine/dbal:^3.0" --no-interaction --no-update
composer require "laravel/framework:9.*" "doctrine/dbal:^3.0" --no-interaction --no-update
composer update --prefer-stable --prefer-dist --no-interaction
- name: Execute tests
Expand All @@ -52,12 +52,10 @@ jobs:
matrix:
os: [ubuntu-latest]
php: [8.1, 8.0]
laravel: [9.*, 8.*]
laravel: [9.*]
include:
- laravel: 9.*
testbench: 7.*
- laravel: 8.*
testbench: 6.*
name: PHP ${{ matrix.php }} - LARAVEL ${{ matrix.laravel }}

steps:
Expand Down Expand Up @@ -110,8 +108,11 @@ jobs:
- name: Build twill.
run: ./vendor/bin/testbench twill:build --forTesting

- name: Upgrade Chrome
uses: browser-actions/setup-chrome@latest

- name: Upgrade Chrome Driver
run: ./vendor/bin/testbench dusk:chrome-driver
run: ./vendor/bin/testbench dusk:chrome-driver --detect

- name: Execute tests
run: vendor/bin/testbench package:test
Expand Down
48 changes: 27 additions & 21 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,35 +27,37 @@
"ext-json": "*",
"ext-pdo": "*",
"astrotomic/laravel-translatable": "^11.5",
"cartalyst/tags": "^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0",
"cartalyst/tags": "^12.0",
"doctrine/dbal": "^3.0",
"guzzlehttp/guzzle": "^6.2|^7.0",
"guzzlehttp/guzzle": "^7.0",
"imgix/imgix-php": "^3.0",
"laravel/framework": "^8.0|^9.0",
"laravel/socialite": "^4.2|^5.0",
"laravel/ui": "^1.0|^2.0|^3.0",
"league/flysystem-aws-s3-v3": "^1.0|^2.0|^3.0",
"laravel/framework": "^9.0",
"laravel/socialite": "^5.3",
"laravel/ui": "^3.0",
"league/flysystem-aws-s3-v3": "^3.0",
"league/glide-laravel": "^1.0",
"matthewbdaly/laravel-azure-storage": "^1.3|^2.0",
"matthewbdaly/laravel-azure-storage": "^2.0",
"myclabs/php-enum": "^1.5",
"pragmarx/google2fa-qrcode": "^1.0|^2.0",
"spatie/laravel-activitylog": "^2.5|^3.2|^4.0",
"spatie/laravel-analytics": "^3.6|^4.0",
"spatie/once": "^2.0|^3.0"
"pragmarx/google2fa-qrcode": "^2.0",
"spatie/laravel-activitylog": "^4.0",
"spatie/laravel-analytics": "^4.0",
"spatie/once": "^3.0"
},
"require-dev": {
"chillerlan/php-qrcode": "~2.0|~3.0|~4.0",
"friendsofphp/php-cs-fixer": "^2.16|^3.0",
"kalnoy/nestedset": "^5.0|^6.0",
"nette/php-generator": "^4.0",
"nunomaduro/collision": "^3.0|^4.2|^5.0|^6.0",
"nunomaduro/larastan": "^1.0|^2.0",
"orchestra/testbench": "^6.0|^7.8",
"orchestra/testbench-dusk": "^6.0|^7.8",
"chillerlan/php-qrcode": "~4.0",
"friendsofphp/php-cs-fixer": "^3.0",
"kalnoy/nestedset": "^6.0",
"nette/php-generator": "v4.0.3",
"nunomaduro/collision": "^6.0",
"nunomaduro/larastan": "^2.0",
"orchestra/testbench": "^7.8",
"orchestra/testbench-dusk": "^7.8",
"phpunit/phpunit": "~9.0",
"rector/rector": "^0.12.15",
"spatie/invade": "^1.1",
"squizlabs/php_codesniffer": "*"
"squizlabs/php_codesniffer": "*",
"torchlight/torchlight-commonmark": "^0.5",
"area17/phptorch": "dev-main"
},
"autoload": {
"psr-4": {
Expand All @@ -67,6 +69,7 @@
"A17\\Twill\\Tests\\Unit\\": "tests/unit",
"A17\\Twill\\Tests\\Integration\\": "tests/integration",
"A17\\Twill\\Tests\\Browser\\": "tests/Browser",
"A17\\Docs\\": "docs/generator",
"App\\": "vendor/orchestra/testbench-core/laravel/app"
}
},
Expand Down Expand Up @@ -101,6 +104,9 @@
"minimum-stability": "dev",
"prefer-stable": true,
"config": {
"sort-packages": true
"sort-packages": true,
"allow-plugins": {
"cweagans/composer-patches": true
}
}
}
14 changes: 12 additions & 2 deletions config/twill.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,18 @@
| This value is the URL of your admin application.
|
*/
'admin_app_url' => env('ADMIN_APP_URL', 'admin.' . env('APP_URL')),
'admin_app_path' => env('ADMIN_APP_PATH', ''),
'admin_app_url' => env('ADMIN_APP_URL', null),
'admin_app_path' => env('ADMIN_APP_PATH', 'admin'),

/*
|--------------------------------------------------------------------------
| Application strict url handeling
|--------------------------------------------------------------------------
|
| Setting this value to true will enable strict domain handling.
|
*/
'admin_app_strict' => env('ADMIN_APP_STRICT', false),

/*
|--------------------------------------------------------------------------
Expand Down
8 changes: 1 addition & 7 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,2 @@
.idea
_build
node_modules
docs
src/.vuepress/dist
!src/.vuepress/public

# generated using npm scripts
/README.md
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
5 changes: 5 additions & 0 deletions docs/_templates/assets/twill_logo.svg
File renamed without changes
File renamed without changes
34 changes: 34 additions & 0 deletions docs/_templates/components/alert.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
@props(['type' => 'success'])
@if ($type === 'success')
<div class="rounded-md bg-green-50 p-4">
<div class="flex">
<div class="ml-3">
<p class="text-sm font-medium text-green-800">{{$slot}}</p>
</div>
</div>
</div>
@elseif($type === 'warning')
<div class="rounded-md bg-yellow-50 p-4">
<div class="flex">
<div class="ml-3">
<p class="text-sm font-medium text-yellow-800">{{$slot}}</p>
</div>
</div>
</div>
@elseif($type === 'info')
<div class="rounded-md bg-blue-50 p-4">
<div class="flex">
<div class="ml-3">
<p class="text-sm font-medium text-blue-800">{{$slot}}</p>
</div>
</div>
</div>
@elseif($type === 'danger')
<div class="rounded-md bg-red-50 p-4">
<div class="flex">
<div class="ml-3">
<p class="text-sm font-medium text-red-800">{{$slot}}</p>
</div>
</div>
</div>
@endif
3 changes: 3 additions & 0 deletions docs/_templates/components/card.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<div class="p-8 border rounded-lg">
{{$slot}}
</div>
4 changes: 4 additions & 0 deletions docs/_templates/components/filename.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<div class="border rounded-lg px-4 border-b-none -mb-8 flex items-center gap-4">
<div class="text-gray-500">File:</div>
<div class="flex-1">{{$slot}}</div>
</div>
3 changes: 3 additions & 0 deletions docs/_templates/components/grid.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<div class="grid grid-cols-3 gap-4">
{{$slot}}
</div>
3 changes: 3 additions & 0 deletions docs/_templates/components/tab.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<div x-show="activeTab === '{{$name}}'">
{{$slot}}
</div>
19 changes: 19 additions & 0 deletions docs/_templates/components/tabs.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<div class="flex flex-col" x-data="{ activeTab: '{{$currenttab ?? ''}}' }">
<div class="inline-flex rounded-lg my-3 bg-opacity-30">
@foreach ($items ?? [] as $item)
<button @click="activeTab = '{{$item}}'"
:class="{
'rounded-r-lg': {{$loop->last ? 'true' : 'false'}},
'rounded-l-lg': {{$loop->first ? 'true' : 'false'}},
'border-grey-500 bg-gray-500 !text-white': activeTab === '{{$item}}'
}"
class="py-[10px] sm:py-2 my-1 px-[12px] sm:px-6 inline-flex items-center justify-center font-medium border border-gray-50 text-center focus:bg-primary text-black text-sm sm:text-base capitalize bg-white"
>
{{$item}}
</button>
@endforeach
</div>
<div>
{{$slot}}
</div>
</div>
166 changes: 166 additions & 0 deletions docs/_templates/layout.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>{{$title}}</title>
<link href="/style.css" rel="stylesheet">
<script src="//unpkg.com/alpinejs" defer></script>
</head>
<body>
@php
$currentSegment = \Illuminate\Support\Str::before(ltrim($url, '/'), '/');
@endphp
<div class="flex flex-col h-screen overflow-hidden print:h-full" x-data="{open: false}">
<nav class="bg-white shadow">
<div class="mx-auto px-2 sm:px-6 lg:px-4">
<div class="relative flex h-16 justify-between">
<div class="absolute inset-y-0 left-0 flex items-center md:hidden">
<button
x-on:click="open = !open"
type="button"
class="inline-flex items-center justify-center rounded-md p-2 text-gray-400 hover:bg-gray-100 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-indigo-500"
aria-controls="mobile-menu" aria-expanded="false">
<span class="sr-only">Open main menu</span>
<svg class="block h-6 w-6" x-bind:class="{hidden: open}" xmlns="http://www.w3.org/2000/svg"
fill="none" viewBox="0 0 24 24"
stroke-width="1.5" stroke="currentColor" aria-hidden="true">
<path stroke-linecap="round" stroke-linejoin="round"
d="M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5"/>
</svg>
<svg class="hidden h-6 w-6" x-bind:class="{hidden: !open}" xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
stroke-width="1.5" stroke="currentColor" aria-hidden="true">
<path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12"/>
</svg>
</button>
</div>
<div class="flex flex-1 items-center justify-center md:items-stretch md:justify-between">
<div class="flex flex-shrink-0 items-center">
<a href="/index.html">
<img class="block h-8 w-auto lg:hidden" src="/assets/twill_logo.svg" alt="Twill">
<img class="hidden h-8 w-auto lg:block" src="/assets/twill_logo.svg" alt="Twill">
</a>
</div>
<div class="hidden md:ml-6 md:flex md:space-x-8 print:!hidden">
@foreach($tree as $key => $item)
@unless($key === '')
<a href="{{$item['url']}}"
class="inline-flex items-center border-b-2 border-transparent px-1 pt-1 text-sm font-medium text-gray-500 hover:border-gray-300 hover:text-gray-700">{{$item['title']}}</a>
@endunless
@endforeach
</div>
<div class="hidden md:ml-6 md:flex md:space-x-8 print:!hidden">
<div class="flex items-center">
<a href="https://github.com/area17/twill" target="_blank"
class="bg-black text-white rounded-lg text-white m-4 px-2 py-2 text-baseline"
rel="noopener">
GitHub
</a>
</div>
</div>
</div>
</div>
</div>
</nav>

<div class="flex flex-1 overflow-hidden">
@if (isset($tree[$currentSegment]))
<div class="xl:w-72 overflow-x-hidden overflow-y-auto p-4 pt-8 md:block print:!hidden"
x-transition
x-bind:class="{hidden: !open}"
>
<nav class="text-base lg:text-sm w-64 pr-8 xl:w-72 xl:pr-16">
<ul role="list" class="space-y-5">
@foreach($tree as $key => $item)
@unless($key === '')
<li class="md:hidden"><a href="{{$item['url']}}"
class="inline-flex items-center border-b-2 border-transparent px-1 pt-1 text-sm font-medium text-gray-500 hover:border-gray-300 hover:text-gray-700">{{$item['title']}}</a>
</li>
@endunless
@endforeach

<li>
<a href="{{$tree[$currentSegment]['url'] ?? '#'}}">
<h2 class="font-display font-medium text-slate-900 dark:text-white">
{{$tree[$currentSegment]['title'] ??''}}
</h2></a>
@if (!empty($tree[$currentSegment]['items'] ??[]))
<ul class="mt-2 space-y-1 border-l-2 border-slate-100 lg:mt-2 lg:space-y-2 lg:border-slate-200">
@foreach($tree[$currentSegment]['items'] ?? [] as $item)
@php
$open = \Illuminate\Support\Str::betweenFirst(ltrim($item['url'], '/'), '/', '/') === \Illuminate\Support\Str::betweenFirst(ltrim($url, '/'), '/', '/');
@endphp
<li class="relative" x-data="{open: {{$open ? 'true' : 'false'}}}">
<div class="flex">
<a
class="inline pl-3.5 before:pointer-events-none before:absolute before:-left-1 before:top-1/2 before:h-1.5 before:w-1.5 before:-translate-y-1/2 before:rounded-full text-slate-500 before:hidden before:bg-slate-300 hover:text-slate-600 hover:before:block @if($open) text-black font-bold @endif"
href="{{$item['url'] ??'#' }}">{{$item['title'] ?? ''}}</a>
@if (!empty($item['items'] ??[]))
<div class="flex-1 cursor-pointer px-5 items-center flex"
x-on:click="open = !open">

<svg xmlns="http://www.w3.org/2000/svg" fill="none"
viewBox="0 0 24 24" stroke-width="1.5"
x-cloak
stroke="currentColor" class="w-3 h-3" x-show="!open">
<path stroke-linecap="round" stroke-linejoin="round"
d="M12 4.5v15m7.5-7.5h-15"/>
</svg>

<svg xmlns="http://www.w3.org/2000/svg" fill="none"
viewBox="0 0 24 24" stroke-width="1.5"
stroke="currentColor" class="w-3 h-3" x-show="open">
<path stroke-linecap="round" stroke-linejoin="round"
d="M19.5 12h-15"/>
</svg>
</div>
@endif
</div>
@if (!empty($item['items'] ??[]))
<ul class="@if ($open) block @else hidden @endif mt-2 ml-4 space-y-1 border-l-2 border-slate-100 lg:mt-4 lg:space-y-2 lg:border-slate-200"
x-bind:class="{'hidden': !open}"
@foreach($item['items'] ?? [] as $item)
@php
$active = $url === $item['url'];
@endphp
<li class="relative">
<a
class="block w-full pl-3.5 before:pointer-events-none before:absolute before:-left-1 before:top-1/2 before:h-1.5 before:w-1.5 before:-translate-y-1/2 before:rounded-full text-slate-500 before:hidden before:bg-slate-300 hover:text-slate-600 hover:before:block @if($active) text-black font-bold @endif"
href="{{$item['url'] ?? '#'}}">{{$item['title'] ?? ''}}</a>
</li>
@endforeach
</ul>
@endif
</li>
@endforeach
</ul>
@endif
</li>
</ul>
</nav>
</div>
@endif
<div class="flex-1 flex flex-col overflow-x-hidden overflow-y-auto p-8">
<div class="flex-1 flex flex-wrap h-full">
<div class="flex flex-col h-full">
<div class="max-w-4xl w-full prose prose-gray flex-1">
{!! $content !!}
</div>
<div class="text-gray-400 text-xs pt-4">
© 2020 Twill — Crafted by AREA 17 | Syntax highlighting by <a href="https://torchlight.dev">torchlight.dev</a>
</div>
</div>
<div class="min-w-64 prose order-first xl:order-last print:hidden"
>
{!! $toc !!}
</div>
</div>
</div>
</div>
</div>
</body>
</html>
Loading

0 comments on commit 9d1e0a3

Please sign in to comment.